Bugzilla – Attachment 136544 Details for
Bug 30327
Sort component parts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30327: (follow-up) Fix inconsistencies in syspref names and supply defaults
Bug-30327-follow-up-Fix-inconsistencies-in-syspref.patch (text/plain), 4.30 KB, created by
Katrin Fischer
on 2022-06-25 11:53:07 UTC
(
hide
)
Description:
Bug 30327: (follow-up) Fix inconsistencies in syspref names and supply defaults
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-06-25 11:53:07 UTC
Size:
4.30 KB
patch
obsolete
>From 3e006282c50e29bb83d46da0a239ecffd2152d48 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Sat, 25 Jun 2022 11:18:42 +0000 >Subject: [PATCH] Bug 30327: (follow-up) Fix inconsistencies in syspref names > and supply defaults > >This patch fetches the new sysprefs into variables, providing default title ascending if >they are not set to avoid an undefined concatenation warning > >I also make the update idempotent and fix confusion of plural/singular names > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Biblio.pm | 4 +++- > .../atomicupdate/bug_30327_add_sortComponents_syspref.pl | 6 +++--- > installer/data/mysql/mandatory/sysprefs.sql | 4 ++-- > 3 files changed, 8 insertions(+), 6 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 52cc36f2d6..ea0c9d9f84 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -565,7 +565,9 @@ sub get_components_query { > my $builder = Koha::SearchEngine::QueryBuilder->new( > { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); > my $marc = $self->metadata->record; >- my $sort = C4::Context->preference('ComponentSortField') . "_" . C4::Context->preference('ComponentSortOrder'); >+ my $component_sort_field = C4::Context->preference('ComponentSortField') // "title"; >+ my $component_sort_order = C4::Context->preference('ComponentSortOrder') // "asc"; >+ my $sort = $component_sort_field . "_" . $component_sort_order; > > my $searchstr; > if ( C4::Context->preference('UseControlNumber') ) { >diff --git a/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl b/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl >index 7c64d24c53..cbc9416f9b 100755 >--- a/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl >+++ b/installer/data/mysql/atomicupdate/bug_30327_add_sortComponents_syspref.pl >@@ -2,15 +2,15 @@ use Modern::Perl; > > return { > bug_number => "30327", >- description => "Add ComponentsSortField and ComponentsSortOrder sysprefs", >+ description => "Add ComponentSortField and ComponentSortOrder sysprefs", > up => sub { > my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; > $dbh->do(q{ >- INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES > ('ComponentSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), > ('ComponentSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice') > }); >- say $out "Added ComponentsSortField and ComponentsSortOrder sysprefs"; >+ say $out "Added ComponentSortField and ComponentSortOrder sysprefs"; > }, > }; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 0ea470bcd3..2b083484cf 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -144,8 +144,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'), > ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), > ('CollapseFieldsPatronAddForm','',NULL,'Collapse these fields by default when adding a new patron. These fields can still be expanded.','Multiple'), >-('ComponentsSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), >-('ComponentsSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice'), >+('ComponentSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), >+('ComponentSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice'), > ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), > ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'), > ('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'), >-- >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 30327
:
131998
|
135550
|
135551
|
135730
|
136256
|
136446
|
136447
|
136448
|
136540
|
136541
|
136542
|
136543
| 136544 |
141731