Look for the "finalized" asset version not the latest modified

Created on 29 February 2024, 9 months ago
Updated 28 August 2024, 3 months ago

Problem/Motivation

When I Add media via the media library, I see the version of the asset that is "Finalized" in the DAM. When I save, the asset is displayed as the most recent version. Maybe related to this assumption in /src/Controller/VersionCheckController.php.

// We can assume, that the latest version is the last item of the array.
usort($version_list['versions'], function ($a, $b) {
  return $a['dateLastEdited'] <=> $b['dateLastEdited'];
});

In DAM:

Drupal's media library uses the Final version (v2):

V4 is displayed on the node after save:

Steps to reproduce

  • In the DAM, create 2 versions of an asset. Change v1 to Finalized.
  • In Drupal, add media to a node.
  • Media library and the node display different versions.

Proposed resolution

Use the final version for both thumbnail and display.

๐Ÿ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States capysara

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024