https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14962 --- Comment #693 from Jake Deery (kwenoch) <jake.deery@openfifth.co.uk> --- Created attachment 211985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211985&action=edit Bug 14962: (QA follow-up) Consistent active-display rules, safer check-in, fewer queries One definition of 'active' - Add Koha::Item->active_display_items/active_displays and build active_display_item/active_display on them. active_display_item only looked at the newest display item, so an expired newer entry hid an older, genuinely active display and the substitutions silently vanished. - catalogue/moredetail.pl, circ/pendingreserves.pl, opac/opac-detail.pl and C4/Search.pm each carried their own copy of the loop. Use the new methods. The OPAC copy repeated the display item's own state three times and never checked the display, and concatenated public notes with no separator. - svc/checkouts and GetPendingOnSiteCheckouts each used a different SQL definition of active, and neither matched Koha::Display::Item->active. Use the same rule in both. Search - The staff display filter treated an empty list of viewable libraries as 'see everything', so any failure to identify the patron showed every display. Use an explicit restriction flag that fails closed. - The five display-aware closures ran a regex on values that can be undef (so warnings), repeated a 'Display:' validation that can never match a code, and ran several queries per item. One helper with a single active-display lookup per item gives the same results. Check-in - AddReturn took the item off its display before the check-in was known to succeed, so a refused check-in (not checked out, wrong branch, blocked lost item) still removed it. Decide up front, work out the return library as if it had left, and only remove it once the check-in is accepted. Unknown display_return_over values are logged. Performance and robustness - circ/overdue.pl looked up every item even with the module off. - opac/opac-reserve.pl changed the in-memory Koha::Item columns, which the later display-aware block makes redundant, and risks persisting display values on a store. Revert it. Drop dead code in basket/basket.pl. - strings_map put an object into the payload when a library or item type name was blank. - due_for_removal used UTC rather than the site's date. - A display logged both ENABLED and MODIFY for one change, and MODIFY when nothing changed. Name the no-end date. - Missing explicit use lines, empty POD blocks and a POD typo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.