Bug 33335: Fix JavaScript error on the MARC overlay rules page
authorMarius Mandrescu <marius.mandrescu@inLibro.com>
Tue, 28 Mar 2023 16:04:49 +0000 (12:04 -0400)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 15 Jun 2023 19:38:25 +0000 (19:38 +0000)
commit999b546f28a37092ca7cbf2dab4055dea13943a5
tree644c615e63ab3fe790e7946a0ae2ee5a996e058b
parent16ee64902341c636abf86c49481c552398352bc6
Bug 33335: Fix JavaScript error on the MARC overlay rules page

The "MARC overlay rules" page doesn't display or work correctly
if a patron category code contains a "-".

This happens because of the JavaScript function in
"marc-overlay-rules.tt" line 469. This causes an error
"Uncaught SyntaxError: missing : after property id".

Test plan:
1. Go to Administration > Patron categories.
2. Make sure you don't have a patron category code that contains
   a "-".
3. Go to Administration > Record overlay rules.
4. The table should display correctly, and you can add, edit
   and delete rules.
5. Return to Patron categories.
6. Add a new patron category with a "-" in the patron category code.
7. Return to Record overlay rules page:
   => The page doesn't display and load correctly (see the attached
      image) - the normal DataTables header and footer aren't
      displayed, and you can't add, edit or delete overlay rules.
  => If you turn on web developer tools, an error is displayed in the
     console: "Uncaught SyntaxError: missing : after property id".
8. Apply the patch.
9. Repeat the step 7, the Record overlay rules page should now
   display correctly and you should be able to add, edit and
   delete rules.
10. Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 351e380a1468562fe579e53d85389ccc9a53418e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit e528bb87c7375eaecf11f265b258e2b7ec5ce202)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt