Koha-clms/koha-tmpl
Martin Renvoize 85c37deb77
Bug 41898: (follow-up) Guard bookings.js against missing DOM when patron has no bookings
js/tables/bookings.js unconditionally called AdditionalFilters.init()
for 'filter-completed' and 'filter-cancelled' on every page load where
the script is included. patron-detail-tabs.inc only renders those
filter elements (and #bookings_table itself) when the patron has at
least one booking, past or present. For any patron with no booking
history, this produced two console.debug 'Element not found' messages
on moremember.pl and circ/circulation.pl.

Guard the ready handler on the presence of #bookings_table, mirroring
the existing pattern in holds.js.

Test plan:
1) Open moremember.pl for a patron with no bookings; confirm no
   AdditionalFilters console messages appear.
2) Open moremember.pl / circ/circulation.pl for a patron with
   bookings; confirm the Bookings tab, filters, and table still work
   as before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-15 14:45:13 +00:00
..
intranet-tmpl Bug 41898: (follow-up) Guard bookings.js against missing DOM when patron has no bookings 2026-09-15 14:45:13 +00:00
opac-tmpl Bug 31391: (QA follow-up) Fix check for UseRecalls for messaging preferences in OPAC 2026-09-14 14:16:00 +00:00