From 31de0d27848182f6eb8d282eefd408f14365e20b Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Thu, 3 Apr 2025 12:08:39 -0400 Subject: [PATCH] Bug 17385: Replace "custom" keyword by "html" for consistency Same test plan as before --- C4/XSLT.pm | 2 +- .../bug_17385-CustomOptionForOpacExportOptions_syspref.pl | 4 ++-- installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 2 +- .../opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 2 +- t/db_dependent/XSLT.t | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 22963ab065..43e15bacee 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -444,7 +444,7 @@ sub engine { sub CustomXSLTExportList { my $opac = shift; # opac (1) vs intranet (0) - return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /custom/; + return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /html/; my $customXSLTExportPath = C4::Context->preference('CustomXSLTExportPath'); # Check the cache first diff --git a/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl b/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl index e804c7ee70..6c8e04e082 100644 --- a/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl +++ b/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl @@ -2,7 +2,7 @@ use Modern::Perl; return { bug_number => "17385", - description => "Add a custom option for OpacExportOptions system preference", + description => "Add a custom html option for OpacExportOptions system preference", up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; @@ -10,7 +10,7 @@ return { $dbh->do( q{ UPDATE systempreferences - SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,custom' + SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,html' WHERE variable = 'OpacExportOptions'; } ); diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index fe295496e6..67e49b6a71 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -490,7 +490,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACDetailQRCode','0','','Enable the display of a QR Code on the OPAC detail page','YesNo'), ('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), ('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'), -('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,custom','','Define export options available on OPAC detail page.','multiple'), +('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,html','','Define export options available on OPAC detail page.','multiple'), ('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'), ('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'), ('OPACFineNoRenewals','100','','Fine limit above which user cannot renew books via OPAC','Integer'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index d3eddbe102..bde888e78f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -306,7 +306,7 @@ OPAC: mods: MODS ris: RIS isbd: ISBD - custom: Simple HTML formats + html: Simple HTML formats - - pref: OpacSeparateHoldings choices: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index 70da57f77a..aaa52b2c5b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -98,7 +98,7 @@ [% FOREACH option IN export_options %] [% IF option == 'dc' %] Dublin Core - [% ELSIF option != 'custom' %] + [% ELSIF option != 'html' %] [% SWITCH option %] [% CASE 'bibtex' %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index 3e20388a30..6f932c9bd3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -63,7 +63,7 @@ CSV - [% csv_profile.profile | html %] [% END %] [% FOREACH option IN export_options %] - [% IF option == 'custom' %] + [% IF option == 'html' %] [% FOREACH xsl_export IN xsl_exports %] [% xsl_export.filename | html %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index a45e84bce3..eb4201a4a2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -257,7 +257,7 @@ CSV - [% csv_profile.profile | html %] [% END %] [% FOREACH option IN export_options %] - [% IF option == 'custom' %] + [% IF option == 'html' %] [% FOREACH xsl_export IN xsl_exports %] [% xsl_export.filename | html %] [% END %] diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index ff7850da6c..97f1f7fd26 100755 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -118,7 +118,7 @@ subtest 'Tests moved from t' => sub { make_path( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" ); createXSLTFiles( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" ); - t::lib::Mocks::mock_preference( 'OpacExportOptions', 'custom' ); + t::lib::Mocks::mock_preference( 'OpacExportOptions', 'html' ); my @custom_xslts = @{ C4::XSLT::CustomXSLTExportList(1) }; ok( ( scalar @custom_xslts) == 2, "CustomXSLTExportList finds custom XSLTs" ); @@ -280,7 +280,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { subtest 'CustomXSLTExportList: Check export options' => sub { plan tests => 2; - t::lib::Mocks::mock_preference('OpacExportOptions', 'custom'); + t::lib::Mocks::mock_preference('OpacExportOptions', 'html'); my $list = C4::XSLT::CustomXSLTExportList(1); is( $list>0, 1, 'We expect at least one result: simple export' ); $cache->clear_from_cache('CustomXSLTExportListOPAC'); -- 2.43.0