From 4e3a8022bde7f0252fd70b9ff843847989ab6add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 22 Feb 2025 17:26:30 +0100 Subject: [PATCH] Let media_url stay in API attachments responses for backward compatibility --- src/Serializer/AttachmentNormalizer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Serializer/AttachmentNormalizer.php b/src/Serializer/AttachmentNormalizer.php index 29f589bb..4beeb853 100644 --- a/src/Serializer/AttachmentNormalizer.php +++ b/src/Serializer/AttachmentNormalizer.php @@ -57,6 +57,10 @@ class AttachmentNormalizer implements NormalizerInterface, NormalizerAwareInterf //Add thumbnail url if the attachment is a picture $data['thumbnail_url'] = $object->isPicture() ? $this->attachmentURLGenerator->getThumbnailURL($object) : null; + //For backwards compatibility reasons + //Deprecated: Use internal_path and external_path instead + $data['media_url'] = $data['internal_path'] ?? $object->getExternalPath(); + return $data; }