Bug 35783

Summary: Remove Koha::Template::Plugin::Biblio::RecallsCount
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, david, fridolin.somers, kyle, martin.renvoize, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:
Bug Depends on: 35782    
Bug Blocks: 35781    
Attachments: Bug 35783: Replace TT plugin's method Biblio::RecallsCount
Bug 35783: Replace TT plugin's method Biblio::RecallsCount
Bug 35783: Replace TT plugin's method Biblio::RecallsCount
Bug 35783: Replace TT plugin's method Biblio::RecallsCount

Description Jonathan Druart 2024-01-12 08:40:25 UTC
RecallsCount must be replaced with biblio.recalls.search( completed => 0).count
Comment 1 Jonathan Druart 2024-01-12 08:42:46 UTC
Created attachment 160899 [details] [review]
Bug 35783: Replace TT plugin's method Biblio::RecallsCount

We can use biblio.recalls.search( completed => 0 ).count instead.

Test plan:
1. Go to the biblio detail view, click on the different entries in the menu
on the left. Confirm that the "Recalls" tab always has the correct number
of current recalls display in the parenthesis.

2. Run a search and confirm that the number of current recalls are still displayed
for each result.
Comment 2 David Nind 2024-01-12 10:56:26 UTC
I have had a go at testing.

For me, there were no changes on record page - things worked as expected.

However, it didn't show in the search results (it just showed Recalls (0)). It did work before the patches were applied.

Testing notes (using KTD):

1. Apply the patch, run updatedatabase, restart_all

2. Enable the UseRecalls system preference

3. Set the circulation rules. For ALL ALL:
   - Recalls allowed (total): 5
   - Recalls per record (count): 5
   - On shelf recalls allowed: If any available
   - Recall due date interval (day): 5
   - Recall overdue fine amount: 1
   - Recall pickup period (day): 2

4. Checkout two different records to different patrons
   - Programming Perl (262): Mary Burton
   - Perl template toolkit (255): Bobbie Middleton

5. Use the Koha user to place recall for the two records in the OPAC.

6. Look at the record in the staff interface - the tab for recalls should show the correct number of recalls (Recalls (1)).

7. Do a search that should return the record - it should show Recalls (1) as well.

8. Repeat steps 5-6 with a different patron (I used Henry). The number should change to match the number of recalls (Recalls (2)) in the record and search results.
Comment 3 Jonathan Druart 2024-01-12 11:13:22 UTC
Created attachment 160931 [details] [review]
Bug 35783: Replace TT plugin's method Biblio::RecallsCount

We can use biblio.recalls.search( completed => 0 ).count instead.

Test plan:
1. Go to the biblio detail view, click on the different entries in the menu
on the left. Confirm that the "Recalls" tab always has the correct number
of current recalls display in the parenthesis.

2. Run a search and confirm that the number of current recalls are still displayed
for each result.
Comment 4 Jonathan Druart 2024-01-12 11:13:40 UTC
Oops sorry, inverted one flag. Should work now!
Comment 5 David Nind 2024-01-12 11:23:19 UTC
Created attachment 160934 [details] [review]
Bug 35783: Replace TT plugin's method Biblio::RecallsCount

We can use biblio.recalls.search( completed => 0 ).count instead.

Test plan:
1. Go to the biblio detail view, click on the different entries in the menu
on the left. Confirm that the "Recalls" tab always has the correct number
of current recalls display in the parenthesis.

2. Run a search and confirm that the number of current recalls are still displayed
for each result.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Kyle M Hall (khall) 2024-01-12 13:41:10 UTC
Created attachment 160963 [details] [review]
Bug 35783: Replace TT plugin's method Biblio::RecallsCount

We can use biblio.recalls.search( completed => 0 ).count instead.

Test plan:
1. Go to the biblio detail view, click on the different entries in the menu
on the left. Confirm that the "Recalls" tab always has the correct number
of current recalls display in the parenthesis.

2. Run a search and confirm that the number of current recalls are still displayed
for each result.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Kyle M Hall (khall) 2024-01-12 13:42:44 UTC
We should probably have a follow-up bug to remove the subroutine in 24.11
Comment 8 Jonathan Druart 2024-01-12 14:07:50 UTC
(In reply to Kyle M Hall from comment #7)
> We should probably have a follow-up bug to remove the subroutine in 24.11

Yes! Done. Bug 35791.
Comment 9 Katrin Fischer 2024-03-22 09:37:26 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-05-22 14:05:43 UTC
Not backported to 23.11.x
Comment 11 Caroline Cyr La Rose 2024-07-04 18:39:58 UTC
Architecture change, nothing to add/edit in the Koha manual.