Problem/Motivation
The query parameter destination is not set when a flag is deleted.
This makes not possible to return back to the content that has been unflagged.
Steps to reproduce
Test precondition: edit flag configuration as follow
- Set Link Type = Field Entry Form within the Display Options
- Set Form Behaviour = Dialog
Step to reproduce with Bookmark flag
- Go to the selected content
- Click on "Bookmark this" link to open the dialog
- Click the "Create flag" button to flag the content
- Go again to the selected content
- Click on "Remove bookmark" link to reopen the dialog
- Click the "Delete flagging" button to unflag the content
- In the confirmation page, click again on Delete Flagging
Expected behaviour: the flag is removed, the user is redirected back to the content page
Actual behaviour: the user stays in the unflag confirmation page because the destination param is not set
Proposed resolution
destination url param has to be properly set when the user clicks on the "Delete flagging" button.
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
alanhdev commentedI have just run into this issue myself and found this issue open already. It looks like the destination route parameter isn't being set properly in FlaggingForm.php. The attached patch fixes it for me.
Comment #3
axel80 commentedThe patch worked for me as well.
Destination parameter is now set correctly when the content is flagged or unflagged.
Thanks @AlanHDev
Comment #4
nejcramsak commented+1 The patch worked for me also. Setting this as RTBC.
Comment #5
neurer commented+1 Tested. Works. Please commit.
Comment #6
zenimagine commentedThanks, I just applied the patch and it fixes the problem.
Comment #7
aharown07 commentedPatch applied. Problem fixed. No other problems.
(Drupal 9.3, Flag 8.x-4.0-beta3)
Comment #8
bserem commentedThe patch works without problems.
It would be nice to include this in an upcoming release.
Comment #9
berdirCommitted.