Problem/Motivation
To reproduce:
Go to Block layout (admin/structure/block).
Choose a region and click Place block.
Select a block to place, and configure it.
After this is done, I would expect to go back to the Block layout page. Instead, I am looking at the list of available blocks (admin/structure/block/library/bartik, which you normally only see as a pop-up window after clicking Place block).
The bug appears in 8.2.x and exists in 8.3.x.
Proposed resolution
Make it so after placing a block, you get back to the main block layout page.
Remaining tasks
Fix the bug and make a patch. If possible, make a test for it too.
User interface changes
After placing a block, you should get back to the main block layout page.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | interdiff-2794559-14.txt | 611 bytes | tuutti |
| #14 | regression_after-2794559-14.patch | 5.72 KB | tuutti |
| #11 | interdiff.txt | 1.79 KB | willzyx |
| #11 | regression_after-2794559-11.patch | 4.99 KB | willzyx |
| #11 | regression_after-2794559-11-test-only.patch | 1.89 KB | willzyx |
Comments
Comment #2
evaldask commentedA bit weird for sure. This patch should fix that.
Comment #3
evaldask commentedComment #4
evaldask commentedA nicer implementation
Comment #6
cilefen commentedThis appears in 8.2 and exists in 8.3.
Comment #7
cilefen commented#2745911: Block add links should respect destination
Comment #8
cilefen commentedComment #9
willzyx commentedThe problem seems to be the usage of
RedirectDestination::get(). This method always return a result even if the 'destination' query string is not set:so if the destination is not set the current route path is returned.
Probably you can use the value retrieved from the request instead of rely on redirect destination service
Comment #10
willzyx commentedComment #11
willzyx commentedAdded a test for ensure that if destination query string is not present you are redirected by default to the block list page
Comment #13
tim.plunkettHonestly I would consider this a bug in
RedirectDestination::get(), but I don't think we can change that behavior without breaking BC, so I agree this is a good fix.We should probably document that
RedirectDestination::get()will ALWAYS return something, even if it's the current page.Comment #14
tuutti commented+1 to this.
I copied @return comment from
RedirectDestinationInterface::getAsArray()to::get(). Not sure if further documentation is needed.Comment #15
dawehnerGiven the regression, I think we should actually revert the patch and then fix stuff without introducing a regression in the first place. This could easily affect other code as well.
Comment #16
tim.plunkettMarked #2745911: Block add links should respect destination for revert.
Let's correctly fix it again from scratch.