Split attachment path into internal and external path, so the external source URL can be retained after a file is downloaded

This commit is contained in:
jona 2025-01-13 04:53:05 +01:00
parent 5bb79b5419
commit ceb7c7bd65
21 changed files with 399 additions and 303 deletions

View file

@ -52,8 +52,8 @@ class AttachmentNormalizer implements NormalizerInterface, NormalizerAwareInterf
$context[self::ALREADY_CALLED] = true;
$data = $this->normalizer->normalize($object, $format, $context);
$data['internal_path'] = $this->attachmentURLGenerator->getInternalViewURL($object);
$data['media_url'] = $this->attachmentURLGenerator->getViewURL($object);
//Add thumbnail url if the attachment is a picture
$data['thumbnail_url'] = $object->isPicture() ? $this->attachmentURLGenerator->getThumbnailURL($object) : null;