Bug 37031 - Club enrollment doesn't complete in staff interface
Summary: Club enrollment doesn't complete in staff interface
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Phil Ringnalda (back in August)
QA Contact: Testopia
URL:
Keywords: rel_23_11_candidate, rel_24_05_candidate
Depends on: 35942
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-05 01:57 UTC by David Roberts
Modified: 2024-07-11 20:21 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes a typo in the code that causes the enrollment of a patron in a club to fail.
Version(s) released in:
24.11.00


Attachments
Bug 37031: Club enrollment from staff interface fails due to Entrollment typo (1.26 KB, patch)
2024-07-06 22:45 UTC, Phil Ringnalda (back in August)
Details | Diff | Splinter Review
Bug 37031: Club enrollment from staff interface fails due to Entrollment typo (1.30 KB, patch)
2024-07-09 10:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 37031: Club enrollment from staff interface fails due to Entrollment typo (1.38 KB, patch)
2024-07-10 13:37 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Roberts 2024-06-05 01:57:12 UTC
If you enroll a user into a club from the issues tab on a user record, it never completes. This is due to a typo in line 64 of /usr/share/koha/intranet/cgi-bin/svc/club/enroll which says

 my $already_enrolled = Koha::Club::Entrollments->search(

Changing this line to

 my $already_enrolled = Koha::Club::Enrollments->search(

seems to fix the problem.
Comment 1 Matt Blenkinsop 2024-06-18 09:09:09 UTC
Bug 35942 is missing from main so this fix can't currently be implemented
Comment 2 Phil Ringnalda (back in August) 2024-07-06 22:19:00 UTC
It's on main now.

For extra fun, the backport patch for 23.05 didn't have this typo, so it currently affects 24.11, 23.11, and 24.05 once the offending patch gets backported there.
Comment 3 Phil Ringnalda (back in August) 2024-07-06 22:45:01 UTC
Created attachment 168573 [details] [review]
Bug 37031: Club enrollment from staff interface fails due to Entrollment typo

Having svc/club/enroll try to call Koha::Club::Entrollments->search would
have been great trolling, if only it had been intentional and if only any
of the people signing off had noticed it.

Test plan:
1. Without the patch, Tools - Patron clubs - New club template - name it
   and save
2. New club - (your template) - name it and save
3. Circulation - check out to a patron - Clubs tab - Enroll - Finish
   enrollment, get alert() about failure to enroll
4. Apply patch, restart_all
5. Enroll - Finish enrollment, success
Comment 4 David Nind 2024-07-09 10:20:53 UTC
Created attachment 168643 [details] [review]
Bug 37031: Club enrollment from staff interface fails due to Entrollment typo

There is a typo in svc/club/enroll - it tries to call
Koha::Club::Entrollments->search when it should be
Koha::Club::Enrollments. This causes and error when
enrolling patrons in clubs.

Test plan:
1. Without the patch, Tools - Patron clubs - New club template - name it
   and save
2. New club - (your template) - name it and save
3. Circulation - check out to a patron - Clubs tab - Enroll - Finish
   enrollment, get alert() about failure to enroll
4. Apply patch, restart_all
5. Enroll - Finish enrollment, success

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2024-07-09 10:25:02 UTC
Thanks Phil for fixing!

Note: I updated the description for the bug commit message. 
I'm not sure that the previous description should be in the git history - we all make mistakes from time to time, either in testing or QA.
Comment 6 Jonathan Druart 2024-07-10 13:37:54 UTC
Created attachment 168745 [details] [review]
Bug 37031: Club enrollment from staff interface fails due to Entrollment typo

There is a typo in svc/club/enroll - it tries to call
Koha::Club::Entrollments->search when it should be
Koha::Club::Enrollments. This causes and error when
enrolling patrons in clubs.

Test plan:
1. Without the patch, Tools - Patron clubs - New club template - name it
   and save
2. New club - (your template) - name it and save
3. Circulation - check out to a patron - Clubs tab - Enroll - Finish
   enrollment, get alert() about failure to enroll
4. Apply patch, restart_all
5. Enroll - Finish enrollment, success

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Phil Ringnalda (back in August) 2024-07-10 17:39:33 UTC
It's only on 24.05 (once it gets bug 35942) and 23.11 because 23.05 and below got a patch without the typo.
Comment 8 Jonathan Druart 2024-07-11 09:05:48 UTC
(In reply to Phil Ringnalda from comment #7)
> It's only on 24.05 (once it gets bug 35942) and 23.11 because 23.05 and
> below got a patch without the typo.

That's good news!
Comment 9 Katrin Fischer 2024-07-11 11:43:22 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 10 Lucas Gass 2024-07-11 19:58:06 UTC
Merge conflicts here, please rebase for 24.05.x if needed
Comment 11 Phil Ringnalda (back in August) 2024-07-11 20:21:20 UTC
I don't get any conflicts applying it on 24.05.x, now that you've got bug 35942 - did you try to apply this one before that one?