To recreate: 1. Make a suggestion 2. Try to edit, delete, or manage the suggestion. 3. Error: The form submission failed (Wrong CSRF token). Try to come back, refresh the page, then try again.
It looks like the params->{module} doesn't get passed so it output_and_exit_if_error exits.
Created attachment 154719 [details] [review] Bug 34601: Pass module into params 1. Make a suggestion 2. Try to edit, delete, or manage the suggestion. 3. Error: 4. Apply patch and restart_all 5. Try again and you should not get the error anymore.
Created attachment 154720 [details] [review] Bug 34601: Fix edit/delete links on suggestion.tt 1. Make a suggestion 2. Try to edit, delete the suggestion. 3. Error: 4. Apply patch and restart_all 5. Try again and you should not get the error anymore.
Marked as major as it prevents libraries from managing suggestions.
Created attachment 154724 [details] [review] Bug 34601: Fix edit/delete links on suggestion.tt 1. Make a suggestion 2. Try to edit, delete the suggestion. 3. Error: 4. Apply patch and restart_all 5. Try again and you should not get the error anymore. Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Lucas, please remember to run the new perltidy on your changes and the QA test tools! (I amended the patch)
Created attachment 154747 [details] [review] Bug 34601: Fix edit/delete links on suggestion.tt 1. Make a suggestion 2. Try to edit, delete the suggestion. 3. Error: 4. Apply patch and restart_all 5. Try again and you should not get the error anymore. Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 154748 [details] [review] Bug 34601: (QA follow-up) Fix edit/delete links in toolbar We also need to fix the links in the toolbar visible when 'viewing' the suggestion. 1) Create a suggestion 2) Click on the title 3) Click edit > CSRF error 4) Click delete link in toolbar > CSRF error 5) Apply patch and repeat Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 154762 [details] [review] Bug 34601: [22.11.x]Fix edit/delete links on suggestion.tt
Lucas, did you see my follow-up? the original patch was incomplete.
(In reply to Katrin Fischer from comment #10) > Lucas, did you see my follow-up? the original patch was incomplete. Yes, I did. Thanks! I squashed those together for the 22.11 one.
(In reply to Lucas Gass from comment #11) > (In reply to Katrin Fischer from comment #10) > > Lucas, did you see my follow-up? the original patch was incomplete. > > Yes, I did. Thanks! I squashed those together for the 22.11 one. All good then :)
Beware.. I think the archive/unarchive links also need the same treatment ;P
I'll look into providing another follow-up.
(In reply to Martin Renvoize from comment #13) > Beware.. I think the archive/unarchive links also need the same treatment ;P I just tested the archiving and unarchiving of a suggestion and they still work without any error with the other 2 patches applied.
Excellent, that's good news. Thanks for testing it.
The need for the follow-up makes it suspicious. Aren't we over-requiring CSRF tokens here?
Pushed to master for 23.11. Nice work everyone, thanks!
Ich, Typo in commit of master : https://git.koha-community.org/Koha-community/Koha/src/commit/7d5dc65867a55045fa32189d177379e70ecf5725/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt#L850 <a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% s.suggestionid | html %]"&csrf_token=[% csrf_token | html %]> Double quote misplaced.
Can we get this backported?
Created attachment 154951 [details] [review] Bug 34601: Fix wrong quote Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(In reply to Fridolin Somers from comment #19) > Ich, > > Typo in commit of master : Thanks!
Pushed to 23.05.x for 23.05.04
Nice work everyone! Pushed to oldstable for 22.11.x
Thanks for the 22.11 patch!
It happend on 22.05.15. Can we get this backported?
Created attachment 156122 [details] [review] Bug 34601: [22.05.x] Fix edit/delete links on suggestion.tt
Backported to 22.05.x for upcoming 22.05.16