Problem/Motivation

  • When a new version of an image is added in DAM and synced via cron or even manually sync, the media entity doesn’t updates in Drupal successfully.
  • When the asset version is updated in Widen DAM, it does get resynced to the Drupal site, and the updated image appears correctly on pages where it is rendered.
  • However, image thumbnails continue to show the older version of the asset in three key places:
    1. On the node edit page where media is selected.
    2. In the DAM asset popup listing when adding new media.
    3. In the Media Library.

Issue fork acquia_dam-3552089

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajeshreeputra created an issue. See original summary.

becw’s picture

Ooh, perhaps this will address my issue -- I'm experiencing some syncing issues with DAM assets using the "Download and sync assets" option. What I'm seeing is that when I update an image file on the DAM and then run the DAM sync via Drupal cron:

  • The file is updated on the Drupal filesystem (good)
  • The DAM thumbnail (at a path like sites/default/files/acquia_dam_thumbnails/0b503077-2982-4985-9ac1-22dd67350731/2c8954c7-6c41-4b40-ba0f-39ce9e38c8bb.png) shows the old version (bug)
  • The Drupal image style derivative (e.g. sites/default/files/styles/large/public/dam/image/my-image.png) shows the old version (bug)

When I step through the code using xdebug, it appears that image_path_flush() is called, but not for the local file -- only for a file with a path more like 0b503077-2982-4985-9ac1-22dd67350731/2c8954c7-6c41-4b40-ba0f-39ce9e38c8bb.png.

Steps to reproduce

  1. Identify a test image asset in the DAM
  2. Ensure the Drupal image media type is configured to "Download and sync assets"
  3. Use the image in Drupal, in a place that displays an image style
  4. Find the direct URLs for the image, the DAM thumbnail, and the image style derivative on the filesystem
  5. On the DAM, upload a new version of the image (with a distinct visual difference)
  6. Run Drupal cron to sync DAM assets
  7. View the image file directly using its url (good: it is updated)
  8. View the DAM thumbnail directly using its url (bug: it is not updated)
  9. View the image style derivative directly using its url (bug: it is not updated)
rajeshreeputra’s picture

Status: Needs work » Needs review

@becw could you please try applying the changes from this MR, this should fix the issue you mentioned above point 8, 9.

japerry made their first commit to this issue’s fork.

becw’s picture

These changes worked for me, following the steps I outlined above. Thank you!

japerry’s picture

Status: Needs review » Fixed
Issue tags: +Needs followup

A little delay because it is mixing the image plugin derivative with the File entity helper, but thats a problem for another day.

Merged!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.