Bug 35783 - Remove Koha::Template::Plugin::Biblio::RecallsCount
Summary: Remove Koha::Template::Plugin::Biblio::RecallsCount
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on: 35782
Blocks: 35781
  Show dependency treegraph
 
Reported: 2024-01-12 08:40 UTC by Jonathan Druart
Modified: 2024-01-12 14:07 UTC (History)
4 users (show)

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


Attachments
Bug 35783: Replace TT plugin's method Biblio::RecallsCount (4.49 KB, patch)
2024-01-12 08:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35783: Replace TT plugin's method Biblio::RecallsCount (4.49 KB, patch)
2024-01-12 11:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35783: Replace TT plugin's method Biblio::RecallsCount (4.53 KB, patch)
2024-01-12 11:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 35783: Replace TT plugin's method Biblio::RecallsCount (4.59 KB, patch)
2024-01-12 13:41 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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.