https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43996
Bug ID: 43996
Summary: Holds tab count is not updated after cancelling holds
in the patron holds table
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Hold requests
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected], [email protected],
[email protected]
Target Milestone: ---
The count badge on the Holds tab of a patron's circulation.pl and moremember.pl
pages is not updated when a hold is cancelled in the holds table.
Since Bug 40551 the patron holds table cancels holds through the API and just
reloads the table rows, instead of reloading the page. The badge is rendered by
the server from Koha::Holds->count_holds (a hold group counts as one hold), so
it keeps showing the old number until the page is reloaded. This is on vanilla
25.11 as well as main.
To reproduce:
1. Place a hold for a patron
2. Open circulation.pl or moremember.pl for that patron and click the Holds
tab: it shows "Holds (1)"
3. Cancel the hold
4. The table is updated but the badge still shows 1
The fix recounts from the rows of the holds table every time it is drawn, using
the same definition as the server (hold group = one hold). The table loads all
of the patron's holds at once (svc/holds ignores paging), so its rows are all
the holds. The badge is hidden when the count reaches 0, as it is on a fresh
page load. A small helper, updateTabCount() in staff-global.js, does the update
so other tabs can reuse it.
The same problem exists on other patron tabs and could be fixed separately with
the helper: Recalls (cancel/expire in place), Bookings (the JS updates
.bookings_count but the badge has no such class) and Claims (resolving a claim
reloads the table, not #return-claims-count).
Test plan:
1. Place 4 holds for a patron
2. Go to the patron's circulation.pl page and open the Holds tab: the badge
shows 4
3. Cancel one hold: the badge shows 3 (before the patch it stayed at 4)
4. Select two holds, click "Cancel selected" and confirm: the badge shows 1
5. Cancel the last hold: the badge disappears
6. Repeat on members/moremember.pl
7. If DisplayAddHoldGroups is enabled, group two holds: the badge counts the
group as one hold, the same as after a page reload
8. Suspend and resume a hold: the badge does not change
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/