Bug 42014

Summary: Patron lists tab shows blank content when no patron lists exist
Product: Koha Reporter: Paul Derscheid <paul.derscheid>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 42014: Show empty state message on patron lists tab
Bug 42014: (follow-up) Only show empty state when patron is not on any list
Bug 42014: Show empty state message on patron lists tab
Bug 42014: (follow-up) Only show empty state when patron is not on any list

Description Paul Derscheid 2026-03-06 15:11:40 UTC
On the patron detail page, the "Patron lists" tab renders completely empty when no patron lists exist in the system. The tab is shown (because the borrowernumber 51 (koha) for example has manage_patron_lists permission), but the dynamically loaded content from patron-lists-tab.tt contains no HTML, both [% IF in_lists %] and [% IF available_lists && CAN_user_tools_manage_patron_lists %] evaluate to false.

Other tabs follow the convention of showing an empty state message (e.g. "Patron has nothing on hold." for holds, "Patron has nothing booked." for bookings). The patron lists tab should do the same, with a message like "No patron lists. Create a new list." linking to /cgi-bin/koha/patron_lists/add-modify.pl.
Comment 1 Paul Derscheid 2026-03-06 15:16:24 UTC
Created attachment 194739 [details] [review]
Bug 42014: Show empty state message on patron lists tab

- When no patron lists exist in the system, the patron lists
  tab on the patron detail page renders completely blank
- Other tabs follow the convention of showing a message in
  the empty state (e.g. "Patron has nothing on hold.")
- Add an empty state message with a link to create a new
  patron list, matching the established pattern

To test:
- Go to a patron detail page and click the "Patron lists" tab
- If no patron lists exist, observe the tab is blank
- Apply patch
- Repeat the above steps
- Verify the tab now shows "Patron is not on any list." with
  a link to create a new patron list
- Click the link and create a patron list
- Return to the patron detail page and verify the "Add patron
  to list" dropdown now appears instead
Comment 2 Owen Leonard 2026-03-06 16:15:23 UTC
In a case where the logged in user has permission to manage lists, "Patron is not on any list" displays even if the patron is on a list.
Comment 3 Paul Derscheid 2026-03-06 16:16:01 UTC
Thanks, will check.
Comment 4 Paul Derscheid 2026-03-06 16:20:31 UTC
Created attachment 194771 [details] [review]
Bug 42014: (follow-up) Only show empty state when patron is not on any list

- The empty state message was shown when available_lists was empty
  but the patron was already on all existing lists
- Add !in_lists guard so the message only displays when the patron
  is truly not on any list
Comment 5 Owen Leonard 2026-03-06 16:29:22 UTC
Created attachment 194781 [details] [review]
Bug 42014: Show empty state message on patron lists tab

- When no patron lists exist in the system, the patron lists
  tab on the patron detail page renders completely blank
- Other tabs follow the convention of showing a message in
  the empty state (e.g. "Patron has nothing on hold.")
- Add an empty state message with a link to create a new
  patron list, matching the established pattern

To test:
- Go to a patron detail page and click the "Patron lists" tab
- If no patron lists exist, observe the tab is blank
- Apply patch
- Repeat the above steps
- Verify the tab now shows "Patron is not on any list." with
  a link to create a new patron list
- Click the link and create a patron list
- Return to the patron detail page and verify the "Add patron
  to list" dropdown now appears instead

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2026-03-06 16:29:25 UTC
Created attachment 194782 [details] [review]
Bug 42014: (follow-up) Only show empty state when patron is not on any list

- The empty state message was shown when available_lists was empty
  but the patron was already on all existing lists
- Add !in_lists guard so the message only displays when the patron
  is truly not on any list

Signed-off-by: Owen Leonard <oleonard@myacpl.org>