Bug 37374 - Place hold button non-responsive for club holds
Summary: Place hold button non-responsive for club holds
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Sam Lau
QA Contact: Julian Maurice
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-16 15:45 UTC by Andrew Fuerste-Henry
Modified: 2024-09-10 13:58 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.04
Circulation function:


Attachments
Bug 37374: Fix functionality of 'Place hold' button for club holds (1.41 KB, patch)
2024-07-22 15:50 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 37374: Fix functionality of 'Place hold' button for club holds (1.46 KB, patch)
2024-07-22 16:52 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 37374: Fix functionality of 'Place hold' button for club holds (1.52 KB, patch)
2024-07-23 13:33 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 37374: Pass CSRF Token (1.08 KB, patch)
2024-07-24 14:48 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 37374: (follow-up) Add csrf token and op to form (1.27 KB, patch)
2024-07-25 09:57 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2024-07-16 15:45:09 UTC
To reproduce:
 - create a club
 - put 1 patron in your club
 - find a bib
 - Click Holds, then Clubs
 - search for your club, confirm hold detail
 - click Place Hold
 - nothing happens
Comment 1 Sam Lau 2024-07-22 15:50:46 UTC
Created attachment 169315 [details] [review]
Bug 37374: Fix functionality of 'Place hold' button for club holds

To test:
1) create a club
2) put 1 patron in your club
3) find a bib
4) Click Holds, then Clubs
5) search for your club, confirm hold detail
6) click Place Hold
7) nothing happens
8) Apply patch
9) Refresh page and click 'Place hold' again
10) Hold is properly placed
Comment 2 Roman Dolny 2024-07-22 16:52:11 UTC
Created attachment 169319 [details] [review]
Bug 37374: Fix functionality of 'Place hold' button for club holds

To test:
1) create a club
2) put 1 patron in your club
3) find a bib
4) Click Holds, then Clubs
5) search for your club, confirm hold detail
6) click Place Hold
7) nothing happens
8) Apply patch
9) Refresh page and click 'Place hold' again
10) Hold is properly placed

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 Julian Maurice 2024-07-23 13:33:58 UTC
Created attachment 169420 [details] [review]
Bug 37374: Fix functionality of 'Place hold' button for club holds

To test:
1) create a club
2) put 1 patron in your club
3) find a bib
4) Click Holds, then Clubs
5) search for your club, confirm hold detail
6) click Place Hold
7) nothing happens
8) Apply patch
9) Refresh page and click 'Place hold' again
10) Hold is properly placed

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 4 Martin Renvoize (ashimema) 2024-07-23 15:05:18 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 5 Martin Renvoize (ashimema) 2024-07-24 07:56:18 UTC
I should have read this more closely before pushing.. we can't just switch to POST as it triggers the csrf protection QA failures.. we need to handle this properly.
Comment 6 Julian Maurice 2024-07-24 08:00:09 UTC
(In reply to Martin Renvoize from comment #5)
> I should have read this more closely before pushing.. we can't just switch
> to POST as it triggers the csrf protection QA failures.. we need to handle
> this properly.

Ah sorry, I didn't catch that because I use mojolicious apps which are not CSRF-protected (someone, please QA bug 36598 :))
Comment 7 Sam Lau 2024-07-24 14:48:08 UTC
Created attachment 169497 [details] [review]
Bug 37374: Pass CSRF Token
Comment 8 Martin Renvoize (ashimema) 2024-07-24 15:25:46 UTC
We're also failing the tests as there's no 'op' included here ;)

But.. in both cases I believe we're not actually posting a form anyway.. it's getting caught by JS and submitted via ajax to the API which doesn't yet require op or a csrf token.

I think we need to clean up a bit in general
Comment 9 Martin Renvoize (ashimema) 2024-07-25 09:57:28 UTC
Created attachment 169548 [details] [review]
Bug 37374: (follow-up) Add csrf token and op to form

This patch adds a hidden op input and csrf token to the clubs hold
request form.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Lucas Gass (lukeg) 2024-08-28 20:10:48 UTC
Backported to 24.05.x for upcoming 24.05.04
Comment 11 Fridolin Somers 2024-09-10 13:58:18 UTC
"cud-" not for 23.11.x