Koha-clms/circ
Martin Renvoize bb90bd0bab
Bug 41229: Fix desk and register session persistence on library change
When changing library in circ/set-library.pl, desk and register values
were not being properly cleared from the session. This caused stale
desk/register data from the previous library to persist, resulting in:
- Incorrect cashup displays showing wrong library's register
- POS defaulting to registers from different libraries
- Session state inconsistent with visual UI

Three issues fixed:
1. Template: Changed register "None" option ID from "set-library-noregister"
   to "noregister" to match JavaScript expectations (consistent with desk handling)
2. Desk logic: Changed condition to use defined() and explicitly clear session
   when "No desk" is selected
3. Register logic: Added session clearing when "No register" is selected and
   fixed condition to handle empty initial state

Test plan:
1. Select Library A with Register 5
2. Change to Library B without selecting a register
3. Verify register is cleared from session (check POS page)
4. Repeat for desk selection
5. Verify explicit "-- None --" selection clears session values

Signed-off-by: Jason Robb <jrobb@sekls.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 92d6fcf2bd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-12-03 16:44:16 +01:00
..
add_message.pl Bug 38095: Include logged-in branch in custom patron message 2025-02-21 16:41:28 +01:00
article-request-slip.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
article-requests.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
bookcount.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
branchoverdues.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
branchtransfers.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
checkout-notes.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
circulation-home.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
circulation.pl Bug 34596: Add rebuild queue where needed for existing calls to AddReturn 2025-10-29 10:02:24 +01:00
curbside_pickups.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
del_message.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
hold-transfer-slip.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
on-site_checkouts.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
overdue.pl Bug 31167: Only mark due dates in the past red on overdues report 2025-03-21 17:50:27 +01:00
pendingbookings.pl Bug 33736: Add filter for holding library 2024-10-25 11:09:55 +02:00
pendingreserves.pl Bug 40515: Fix regexp for cud-mark_as_lost_and_notify 2025-09-20 10:43:13 +02:00
renew.pl Bug 40866: Remove original Bug 9762 implementation remnants (Part 2 - Renewals) 2025-10-29 10:02:17 +01:00
request-article.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
reserveratios.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
returns.pl Bug 34596: Add rebuild queue where needed for existing calls to AddReturn 2025-10-29 10:02:24 +01:00
set-library.pl Bug 41229: Fix desk and register session persistence on library change 2025-12-03 16:44:16 +01:00
transfer-slip.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
transfers_to_send.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
transferstoreceive.pl Bug 39834: Replace some tabs with spaces 2025-06-17 21:42:59 +02:00
view_holdsqueue.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
waitingreserves.pl Bug 39834: Replace some tabs with spaces 2025-06-17 21:42:59 +02:00