Skip to content

Updating Images via GraphQL Mutation does not update the transform folder #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 3 tasks
krafttoast opened this issue Mar 31, 2025 · 6 comments
Open
1 of 3 tasks

Comments

@krafttoast
Copy link

I'm submitting a...

  • bug report
  • feature request
  • general question

Description:

Expected Behavior:

When updating an image via GraphQL, the folder of the transforms is rebuild and images in entries are updated.

Actual Behavior:

When updating an image via GraphQL, the folder of the transforms is not rebuild. This leads to a state where the assets in Craft have the new image but images in entries and their thumbnail are still persisted as the old images. We have tested this with different instances of Craft using DDEV and Azure. Is there a directive for GraphQL which needs to be sent to update the transformed images as well?

If you need additional info's, I'm happy to help.

Versions:

  • Craft 4.14.10 Pro
  • Imager-X 4.5.1.1
  • PHP 8.2.22
  • Imagick 3.7.0
@hiasl
Copy link

hiasl commented Apr 1, 2025

With "rebuild" we (@krafttoast and I) actually mean, that the folder containing Imager-X's resized images gets deleted (which does not happen through GraphQL submitted image updates). The actual "rebuild" should happen, because Blitz Cache's generator is rebuilding its cache and Imager-X should then recreate the folder and the resized images.

@krafttoast
Copy link
Author

On further investigation we found that the EVENT_AFTER_REPLACE_ASSET, which Imager-X listens on, is not triggered when an asset is updated via GraphQL.

I've opened an issue in the craft repo:
craftcms/cms#17005

@krafttoast
Copy link
Author

@aelvan this will be fixed on Craft's site with the next release (https://github.com/craftcms/cms/blob/4.x/CHANGELOG.md)
I'll close this ticket

@r-anwar
Copy link

r-anwar commented Apr 28, 2025

Hi @aelvan, we have updated to CraftCMS 4.14.15 but are still encountering the same issue.

The specific ImagerX folder for a particular image was not updated — the file timestamps are at least two months old. However, after moving the image folder, a new folder was generated containing the updated images. Can you fix this?

@krafttoast krafttoast reopened this Apr 28, 2025
@aelvan
Copy link
Contributor

aelvan commented Apr 29, 2025

@krafttoast Did the change in 4.14.14 fix the issue you originally had?

@krafttoast
Copy link
Author

For my tests it did fix the issue, I'll have a deeper look at it and will report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants