Bugzilla – Attachment 151116 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: Use To.json to serialize
Bug-33335-Use-Tojson-to-serialize.patch (text/plain), 2.37 KB, created by
Jonathan Druart
on 2023-05-12 07:25:56 UTC
(
hide
)
Description:
Bug 33335: Use To.json to serialize
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-05-12 07:25:56 UTC
Size:
2.37 KB
patch
obsolete
>From 7184298d15b5bffcf2040a16820f19e2046d9b75 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 2 May 2023 16:26:45 +0200 >Subject: [PATCH] Bug 33335: Use To.json to serialize > >--- > admin/marc-overlay-rules.pl | 10 ++++++---- > .../prog/en/modules/admin/marc-overlay-rules.tt | 11 +++++------ > 2 files changed, 11 insertions(+), 10 deletions(-) > >diff --git a/admin/marc-overlay-rules.pl b/admin/marc-overlay-rules.pl >index 05a5bbe5817..b3e0a86f8da 100755 >--- a/admin/marc-overlay-rules.pl >+++ b/admin/marc-overlay-rules.pl >@@ -132,11 +132,13 @@ elsif ($op eq 'doedit' || $op eq 'add') { > } > } > >-my $categorycodes = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']}); >+my $categories = Koha::Patron::Categories->search_with_library_limits( {}, >+ { order_by => ['description'] } )->unblessed; >+ > $template->param( >- rules => $rules, >- categorycodes => $categorycodes, >- messages => $errors >+ rules => $rules, >+ categories => $categories, >+ messages => $errors > ); > > output_html_with_http_headers $input, $cookie, $template->output; >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 898a4cac02f..fbdc3813ad4 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 >@@ -1,4 +1,5 @@ > [% USE raw %] >+[% USE To %] > [% USE Asset %] > [% SET footerjs = 1 %] > [% USE Koha %] >@@ -454,11 +455,9 @@ > } > }); > >- var $category = {}; >- >- [% FOR categorycode IN categorycodes %] >- $category["[% categorycode.categorycode %]"] = "[% categorycode.description | html %]"; >- [% END %] >+ var categories = [% To.json( categories ) | $raw %]; >+ categories.unshift({ categorycode: '*', description: '*'}); >+ categories = categories.reduce( ( a,c ) => ( { ...a, [c.categorycode]: c.description } ), {} ); > > var module_filter_options = { > source: { >@@ -471,7 +470,7 @@ > import_lexile: _("import_lexile.pl") > }, > >- categorycode: $category >+ categorycode: categories, > }; > > //Kind of hack: Replace filter value with label when one exist >-- >2.25.1
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