Bug 37634 - Missing "USE Koha" causes JS errors and missing "Last patron" menu
Summary: Missing "USE Koha" causes JS errors and missing "Last patron" menu
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-13 17:00 UTC by Katrin Fischer
Modified: 2024-11-30 18:09 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the cause of the "Last patron" menu not displaying on many staff interface pages, or generating JavaScript errors (where showLastPatron is enabled). (It adds "[% USE Koha %]" to templates where it was missing. It also removes some duplicate USE entries.)
Version(s) released in:
Circulation function:


Attachments
Bug 37634: Missing "USE Koha" causes JS errors and missing "Last patron" menu (90.18 KB, patch)
2024-11-26 12:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37634: Missing "USE Koha" causes JS errors and missing "Last patron" menu (90.22 KB, patch)
2024-11-30 17:53 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2024-08-13 17:00:20 UTC
When showLastPatron is active, there is a JS error when looking at the details of a debit:

Uncaught ReferenceError: showLastPatronCount is not defined
    <anonymous> http://localhost:8081/intranet-tmpl/prog/js/staff-global_24.0600023.js:215
    jQuery 13


To test:
* Activate showLastPatron
* Go to a patron account (Henry will do)
* Add a manual invoice
* Click on the "Details" for this invoice
* Verify there is a JS error on the page
Comment 1 Fridolin Somers 2024-11-25 11:28:15 UTC
Also in "Files" tab
Comment 2 Owen Leonard 2024-11-26 12:30:29 UTC
Created attachment 174986 [details] [review]
Bug 37634: Missing "USE Koha" causes JS errors and missing "Last patron" menu

This patch adds "[% USE Koha %]" to templates which lack it. Without
this, the "Last patron" menu item doesn't work and will cause a JS error
on many pages. The patch also removes some USE entries which were
duplicates.

To test, apply the patch and test all 176 different pages to confirm
they all work correctly. I mean, maybe. Or maybe sample a few to confirm
they work?

- Go to Administration -> System preferences and enable "showLastPatron"
- If the preference was not enabled, you probably need to go to
  Circulation and open a patron account for checkout so that there is a
  "last patron" to show.
- Test a sampling of pages affected by this patch:
  - Acquisitions -> Acquisitions home page
  - Administration -> Cities and towns
  - Catalog -> Item search
  - Cataloging -> Label creator
  - Patrons -> Patron account -> Set permissions
  - Reports -> Items lost
  - Serials -> Serials home page
  - Tools -> Calendar
- Pages which had duplicate lines (not necessarily "USE Koha"):
  - Acquisitions -> Vendor -> Receive shipments
  - Administration -> Manage jobs
  - Administration -> Record overlay rules
  - Catalog -> Search results
  - Catalog -> Bibliographic detail page -> Items
  - Circulation -> Holds queue
  - Patrons -> Patron detail page -> Accounting -> Transactions tab
  - Serials -> Subscription details -> Create/edit routing list
  - OPAC -> Search results -> Request article

Sponsored-by: Athens County Public Libraries
Comment 3 David Nind 2024-11-30 17:53:31 UTC
Created attachment 175038 [details] [review]
Bug 37634: Missing "USE Koha" causes JS errors and missing "Last patron" menu

This patch adds "[% USE Koha %]" to templates which lack it. Without
this, the "Last patron" menu item doesn't work and will cause a JS error
on many pages. The patch also removes some USE entries which were
duplicates.

To test, apply the patch and test all 176 different pages to confirm
they all work correctly. I mean, maybe. Or maybe sample a few to confirm
they work?

- Go to Administration -> System preferences and enable "showLastPatron"
- If the preference was not enabled, you probably need to go to
  Circulation and open a patron account for checkout so that there is a
  "last patron" to show.
- Test a sampling of pages affected by this patch:
  - Acquisitions -> Acquisitions home page
  - Administration -> Cities and towns
  - Catalog -> Item search
  - Cataloging -> Label creator
  - Patrons -> Patron account -> Set permissions
  - Reports -> Items lost
  - Serials -> Serials home page
  - Tools -> Calendar
- Pages which had duplicate lines (not necessarily "USE Koha"):
  - Acquisitions -> Vendor -> Receive shipments
  - Administration -> Manage jobs
  - Administration -> Record overlay rules
  - Catalog -> Search results
  - Catalog -> Bibliographic detail page -> Items
  - Circulation -> Holds queue
  - Patrons -> Patron detail page -> Accounting -> Transactions tab
  - Serials -> Subscription details -> Create/edit routing list
  - OPAC -> Search results -> Request article

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2024-11-30 18:09:27 UTC
Testing notes (using KTD):

1. The pages to check in the test plan: 
   1.1 JavaScript error message only generated on Patrons > Patron account > Set permissions
   1.2 Before the patch, most pages were missing the "Last patron" menu.
   1.3 After the patch, the "Last patron" menu now appears on all pages checked.

Should we add a test or something to the QA tools to check for "[% USE Koha %]" in all template pages? (I don't know how this is to do 8-).)