Bugzilla – Attachment 122615 Details for
Bug 28373
Items fields not used in default XSLT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28373: Add PassItemMarcToXSLT system preference
Bug-28373-Add-PassItemMarcToXSLT-system-preference.patch (text/plain), 4.96 KB, created by
Nick Clemens (kidclamp)
on 2021-07-06 12:36:01 UTC
(
hide
)
Description:
Bug 28373: Add PassItemMarcToXSLT system preference
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-07-06 12:36:01 UTC
Size:
4.96 KB
patch
obsolete
>From f45500b0ed09d521dd948f06b2f87b8bbb43e81e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 18 May 2021 15:06:43 +0000 >Subject: [PATCH] Bug 28373: Add PassItemMarcToXSLT system preference > >Default stylesheets do not reference item fields for XSLT display, however, we >spend time translating the values in the item fields. > >This patch adds a system preference, PassItemMarcToXSLT. and unless enabled we remove >item fields before processing > >To test: >1 - Perform some search on the staff client and opac >2 - Use the console (F12) to view the time spent on the network tab >3 - Note performance >4 - Apply patch, updatedatabase, restart_all >5 - Repeat searches >6 - Note that display has not changed >7 - Note performance, results should display slightly faster >--- > C4/Search.pm | 1 + > .../bug28373_add_PassItemMarcToXSLT_preference.perl | 9 +++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/searching.pref | 7 +++++++ > 4 files changed, 18 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl > >diff --git a/C4/Search.pm b/C4/Search.pm >index b0ebedcb57..42e9c2783e 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1758,6 +1758,7 @@ sub searchResults { > > # Pull out the items fields > my @fields = $marcrecord->field($itemtag); >+ $marcrecord->delete_fields( @fields ) unless C4::Context->preference('PassItemMarcToXSLT'); > my $marcflavor = C4::Context->preference("marcflavour"); > > # adding linked items that belong to host records >diff --git a/installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl b/installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl >new file mode 100644 >index 0000000000..f411e02cab >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug28373_add_PassItemMarcToXSLT_preference.perl >@@ -0,0 +1,9 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'); >+ }); >+ >+ NewVersion( $DBversion, 28373, "Add PassItemMarcToXSLT system preference"); >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 3430bc26e7..6d0e8ec6c3 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -507,6 +507,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'), > ('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'), > ('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'), >+('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'), > ('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'), > ('PatronAutoComplete','1','Try|Don\'t try','to guess the patron being entered while typing a patron search for circulation or patron search. Only returns the first 10 results at a time.','YesNo'), > ('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index 25b3878307..7dd1f58911 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -273,6 +273,13 @@ Searching: > 1: "Display" > 0: "Don't display" > - ' Koha record level itemtype info on detail and result pages in the OPAC and staff interface. This info also displays if the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=item-level_itypes">item-level_itypes</a> system preference is set to bibliographic record.' >+ - >+ - pref: PassItemMarcToXSLT >+ type: boolean >+ choices: >+ 1: Do >+ 0: "Don't" >+ - "make item MARC tags available to XSLT stylesheets. Default is \"Don't\", items are disaplyed using other methods" > Did you mean/spell checking: > - > - "Swedish service for spellchecking.<br/>" >-- >2.20.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 28373
:
121115
|
121610
|
121611
|
122614
|
122615
|
122616
|
122628
|
122629
|
122630
|
124019
|
124222
|
124223
|
124224
|
124225
|
124226
|
124254
|
124255
|
124495
|
124496
|
124686