Bugzilla – Attachment 149253 Details for
Bug 33335
MARC overlay rules broken because of "categorycode.categorycode " which contains "-"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33335: Fix JavaScript error on the MARC overlay rules page
Bug-33335-Fix-JavaScript-error-on-the-MARC-overlay.patch (text/plain), 2.89 KB, created by
David Nind
on 2023-04-07 06:36:27 UTC
(
hide
)
Description:
Bug 33335: Fix JavaScript error on the MARC overlay rules page
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-04-07 06:36:27 UTC
Size:
2.89 KB
patch
obsolete
>From acfc300806ff6721555eb160763898abac2e2a37 Mon Sep 17 00:00:00 2001 >From: Marius Mandrescu <marius.mandrescu@inLibro.com> >Date: Tue, 28 Mar 2023 12:04:49 -0400 >Subject: [PATCH] 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> >--- > .../en/modules/admin/marc-overlay-rules.tt | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >index 781457643f..485c8050cc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >@@ -459,8 +459,14 @@ > } > }); > >+ var $category = {}; >+ >+ [% FOR categorycode IN categorycodes %] >+ $category["[% categorycode.categorycode %]"] = "[% categorycode.description | html %]"; >+ [% END %] >+ > var module_filter_options = { >- source: { >+ source: { > '*': '*', > batchmod: _("Batch record modification"), > intranet: _("Staff interface MARC editor"), >@@ -468,13 +474,9 @@ > z3950: _("Z39.50"), > /* bulkmarcimport: _("bulkmarcimport.pl"), */ > import_lexile: _("import_lexile.pl") >- }, >- categorycode: { >- '*': '*', >- [% FOREACH categorycode IN categorycodes %] >- [% categorycode.categorycode | html %]: "[% categorycode.description | html %]", >- [% END %] >- } >+ }, >+ >+ categorycode: $category > }; > > //Kind of hack: Replace filter value with label when one exist >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33335
:
148696
|
148841
|
149253
|
150521
|
151116
|
151119
|
151120
|
151121