Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Not sure if I am alone, but when I try to add an effect to an existing image style, the form returns to the list of styles instead of the effect configuration form.
Tested on simplytest.me
Steps:
1. Edit the 'Thumbnail' style
2. Select a 'Convert' effect
3. Click the 'Add' button close to the effect
I'd expect at this stage the image effect configuration form, but in fact the list of image styles appears instead.
As a workaround, I found that if you edit an existing effect and click on 'Update effect', then you can add further effects.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#11 | 2940165-11.patch | 2.12 KB | mondrake |
#11 | interdiff_9-11.txt | 632 bytes | mondrake |
Comments
Comment #2
mondrakeChecked again on simplytest.me -
with 8.4.4 - works as expected
with 8.5.0-alpha1 - fails
So it seems some regression slipped in the 8.5.x codebase. Bumping to critical to get exposure - there's a workaround (see IS) but it's bad UX.
Comment #3
BerdirNice find.
I guess I broke this :)
The reason is the destination argument in the URL, which overrides the destination set on the URL. This was introduced by #2767857: Add destination to edit, delete, enable, disable links in entity list builders, which adds them automatically to all edit and delete operations. This can cause issues like this if the page then expects to do another redirect.
So we have two options to fix it, Either remove the destination for image styles in \Drupal\image\ImageStyleListBuilder::getDefaultOperations() or unset the destination query argument in that specific submit callback.
Here's a failing test.
Comment #4
BerdirNote: A regression is not automatically critical but I think this is severe enough that it makes sense that this is critical, this is a pretty common UI operation and it will not be obvious at all that it didn't work .
Comment #6
mondrakeBut then what we have here is a BC break, no? I am facing a similar behavior in the Pagerer module - where we have an edit form for a config entity, and a form that is invoked from the edit form to configure a part of the config object. Same as here for image styles where the image style is the config entity and the effects are sub-elements of the configuration.
Comment #7
BerdirIn a way yes, but IMHO it is a change that's worth it. For content entities, views operations already had an option to force the destination link so those already had to be able to handle it. The destination parameter and how it behaves is a general feature, anyone could for some reason build a link to your form with that.
Many forms these days use ajax/dialogs for use cases like that, core has been working for a while now to use it e.g. in the workflows UI, which has similar workflows (and is not affected by this, just tested). Then it's much less of a problem.
I see your argument, there are quite often side effects when we add new features/improvements and it can be annoying when updating, seen this many times myself, but hopefully the 8.x -> 9.x update will be far less complicated than 7.x -> 8.x to make up for that ;)
Comment #8
mondrakeComment #9
mondrakeTrying removing the destination for image styles in
\Drupal\image\ImageStyleListBuilder::getDefaultOperations()
.Comment #10
larowlannit === here, but its not worth knocking this back on that alone
Comment #11
mondrakeFixed the nit in #10.
Comment #14
catchCommitted/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!