Problem/Motivation
Regression from #3325167: Revisit the redirect to 'add block' form in the 'add block content' form
In Drupal 10.1, editing a block by default goes back to the collection.
On Drupal 10.2, it remains on that page.
This is specifically a problem when adding a translation, as that also stays on the same page, but then that results in an exception as the translation already exists.
Steps to reproduce
- On a fresh install
- Create a new block and save it (redirects to the blocks overview),
- Edit the block via directly navigating to the url (i.e do not click Edit from the overview as that will include a destination parameter
- Save the block again
Expected: Redirect to the overview page
Actual: Stay on the edit page
Proposed resolution
Fix the code to go back to overview on edit as well, not just for a new block
Remaining tasks
Create MR.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 3412283-1.patch | 5.22 KB | bingol@ciandt.com |
Issue fork drupal-3412283
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:
- 3412283-editing-a-blockcontent
changes, plain diff MR !6021
Comments
Comment #2
bramdriesenLinking to the parent
Comment #5
mathilde_dumond commentedTo reproduce: on a raw install, add a second language; create a new block; save it (redirects to the blocks overview), then translate it and save -> stays n the same page and complains that the translation already exists.
After the MR: when saving after the translation, we are redirected to the blocks overview page.
Comment #6
bramdriesenUpdating the IS with the steps to reproduce
Comment #7
smustgrave commentedCould we get a failing test as a next step.
Comment #8
larowlanDoes anyone know if we have an existing issue about this behaviour? It feels like it would be better to display a message 'A translation already exists for the {language} language, you have been redirected to the edit form' and redirect
Comment #9
berdirWe should absolutely do that, that uncaught exception is horrible and easy to get to even without this bug (clicking on a already open and outdated translation overview page for example). Found #2745805: Do not fatal when trying to submit a content entity translation twice..
Comment #10
acbramley commentedComment #11
acbramley commentedAdded tests, rebased, and fixed self-review.
Comment #12
smustgrave commentedTest coverage can be seen in the test-only job
Verified following the steps in the issue summary and MR did solve the issue.
Comment #16
catchCommitted/pushed to 11.x, cherry-picked to 10.3.x and 10.2.x, thanks!
Comment #17
bingol@ciandt.com commented