Fix resource normalizer to set content and download URL only for AbstractResource

pull/5052/head
Angel Fernando Quiroz Campos 2 years ago
parent 7a05a6baf4
commit 1b9078810a
  1. 5
      src/CoreBundle/Serializer/ResourceNormalizer.php

@ -77,12 +77,11 @@ final class ResourceNormalizer implements ContextAwareNormalizerInterface, Norma
// Get all links from resource.
if ($object instanceof AbstractResource) {
$object->setResourceLinkListFromEntity();
$object->contentUrl = $this->generator->generate('chamilo_core_resource_view', $params);
$object->downloadUrl = $this->generator->generate('chamilo_core_resource_download', $params);
}
// }
$object->contentUrl = $this->generator->generate('chamilo_core_resource_view', $params);
$object->downloadUrl = $this->generator->generate('chamilo_core_resource_download', $params);
// Get illustration of a resource, instead of looking for the node children to get the illustration.
if ($object instanceof ResourceIllustrationInterface) {
$object->illustrationUrl = $this->illustrationRepository->getIllustrationUrl($object);

Loading…
Cancel
Save