From ce10af303104747d8b8f77d4ba2688f520e6b910 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Oct 2025 11:26:27 +0200 Subject: [PATCH] Bug 30633: Remove OPACHoldingsDefaultSortField It's no longer needed Signed-off-by: Michaela Signed-off-by: Michaela Sieber --- .../data/mysql/atomicupdate/bug_30633.pl | 19 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 - .../en/modules/admin/preferences/opac.pref | 7 ------- .../bootstrap/en/modules/opac-detail.tt | 9 --------- 4 files changed, 19 insertions(+), 17 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_30633.pl diff --git a/installer/data/mysql/atomicupdate/bug_30633.pl b/installer/data/mysql/atomicupdate/bug_30633.pl new file mode 100755 index 0000000000..5d07191938 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30633.pl @@ -0,0 +1,19 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "30633", + description => "Remove system preference OPACHoldingsDefaultSortField", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + DELETE FROM systempreferences + WHERE variable="OPACHoldingsDefaultSortField"; + } + ) == 1 + && say $out "Removed system preference 'OPACHoldingsDefaultSortField'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index c3fa93d504..b47f27df97 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -515,7 +515,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacHiddenItemsExceptions','',NULL,'List of borrower categories, separated by comma, that can see items otherwise hidden by OpacHiddenItems','Textarea'), ('OpacHiddenItemsHidesRecord','1','','Hide biblio record when all its items are hidden because of OpacHiddenItems','YesNo'), ('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'), -('OPACHoldingsDefaultSortField','first_column','first_column|homebranch|holdingbranch','Default sort field for the holdings table at the OPAC','choice'), ('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'), ('OPACHoldRequests','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'), ('OPACHoldsHistory','0','','If ON, enables display of Patron Holds History in OPAC','YesNo'), 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 e764575211..8b4769c17e 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 @@ -317,13 +317,6 @@ OPAC: homebranch: 'home library' holdingbranch: 'holding library' - "is the logged in patrons's library. The second tab will contain all other items." - - - - pref: OPACHoldingsDefaultSortField - choices: - first_column: First column of the table - homebranch: Home library - holdingbranch: Holding library - - "is the default sort field for the holdings table." - - Display up to - pref: OpacMaxItemsToDisplay diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index dec3ac998f..93144bf5bf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -2002,15 +2002,6 @@ }); [% END %] - [%# Note that there is no way atm to target a column with its class name to set it as the default sort order %] - [% IF Koha.Preference('OpacLocationBranchToDisplay') == 'home' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND item_level_itypes OR Koha.Preference('OpacLocationBranchToDisplay') == 'holding' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'holdingbranch' AND item_level_itypes OR Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND NOT item_level_itypes OR Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'holdingbranch' AND item_level_itypes %] - var default_order_index = 1; - [% ELSIF Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND item_level_itypes %] - var default_order_index = 2; - [% ELSE %] - var default_order_index = 0; - [% END %] - [% IF ( query_desc ) %] [% IF ( OpacHighlightedWords ) %] var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; -- 2.39.5