Commit ad751b4d authored by catch's avatar catch
Browse files

Issue #3294883 by marcoscano: Fix inaccurate code comment in Media.php

(cherry picked from commit 69f148f6)
parent 952cb0b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -375,8 +375,8 @@ public function prepareSave() {
        // Try to set fields provided by the media source and mapped in
        // media type config.
        foreach ($translation->bundle->entity->getFieldMap() as $metadata_attribute_name => $entity_field_name) {
          // Only save value in entity field if empty. Do not overwrite existing
          // data.
          // Only save value in the entity if the field is empty or if the
          // source field changed.
          if ($translation->hasField($entity_field_name) && ($translation->get($entity_field_name)->isEmpty() || $translation->hasSourceFieldChanged())) {
            $translation->set($entity_field_name, $media_source->getMetadata($translation, $metadata_attribute_name));
          }