Problem/Motivation

When a user updates the focal point on a DAM media entity via the media edit form, the previously generated image style derivatives are not invalidated. This means the old cropped images continue to be served even after the focal point has been changed.

Steps to reproduce

  • Create or edit a media entity using an Acquia DAM asset.
  • Set a focal point for an image style.
  • Save the form.
  • Edit the media again and change the focal point to a different position.
  • Save the form.
  • Observe that the image style derivative still shows the old crop.

Expected behavior

After updating the focal point crop, the image style for the associated DAM asset URI should be flushed so that the newly cropped derivative is generated on next request.

Proposed resolution

After calling FocalPointMediaEditFormAlter::updateCrop(), load the corresponding ImageStyle entity and call flush() with the original DAM asset URI (acquia-dam://{asset_id}/{version_id}), ensuring stale derivatives are cleared.

Issue fork acquia_dam-3584070

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.

rajeshreeputra’s picture

Status: Active » Needs review

Requesting review.

rajeshreeputra’s picture

Title: Flush image style cache after updating focal point crop on DAM media » Flush image style after updating focal point crop on DAM media
Issue summary: View changes

  • rajeshreeputra committed 087cef41 on 1.1.x
    Resolve #3584070 "Flush image style after updating focal point crop on...
rajeshreeputra’s picture

Status: Needs review » Fixed

Merged!

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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