Problem/Motivation
A plugin that extends CropEffect doesn't have the ?h query parameter added to the URL, so changes are not reflected in a CDN.
Steps to reproduce
Install fresh D9 with image_widget_crop and crop.
1. Create a new crop plugin:
/**
* Crops an image resource.
*
* @ImageEffect(
* id = "crop2",
* label = @Translation("Alternative crop"),
* description = @Translation("Alternatively crop images")
* )
*/
class CropEffect extends ConfigurableImageEffectBase implements ContainerFactoryPluginInterface {
}
2. Create a new crop type
3. Configure a new image style that uses the "Alternative crop" effect.
4. Add an image field to basic page and configure it to use image_widget_crop
5. Under manage display set the image formatter to the cropped image style.
6. Create a node with an image and set the crops
7. View page
Note that the image URL is missing ?h=
If you change the image effect from "Alternative crop" to "Manual crop" then the ?h is present again.
Proposed resolution
There are some areas in crop that are hard coded to the default "crop_crop" plugin. Having this check something else appears to fix the problem.