Update local metadata ignores media entities that refer to same Bynder UUID

Created on 4 August 2022, over 2 years ago
Updated 26 January 2023, almost 2 years ago

We noticed that while using the update local metadata batch script, not all media entities were updated.
By digging deeper in the issue we found out that there are media entities that refer to the same remote Bynder asset (same Bynder UUID).

In the updateMetadataLastMediaEntities() method in BynderService.php following code exists:

// Get the remote media UUIDs.
    foreach ($media_entities as $media_entity) {
      if ($remote_uuid = $media_entity->getSource()->getSourceFieldValue($media_entity)) {
        $bynder_media_entities[$remote_uuid] = $media_entity;
      }
    }

So if two media entities have the same remote UUID, only one will be kept in the array and the other media entity will never be updated.

The Bynder module should handle the situation where there are multiple Drupal entities refering to the same Bynder asset correctly and update all related Drupal entities

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇧🇪Belgium Sebastien VR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024