Bugzilla – Attachment 33617 Details for
Bug 9043
Adding system preferences to control the visibility of the content on the Advanced Search page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9043: The comma (,) should be kept to separate multi-valuated prefs
Bug-9043-The-comma--should-be-kept-to-separate-mul.patch (text/plain), 5.57 KB, created by
Jonathan Druart
on 2014-11-17 16:00:39 UTC
(
hide
)
Description:
Bug 9043: The comma (,) should be kept to separate multi-valuated prefs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-11-17 16:00:39 UTC
Size:
5.57 KB
patch
obsolete
>From 65aae5b8ed68c7ca77ccf5708e464d6f27972810 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 17 Nov 2014 16:55:26 +0100 >Subject: [PATCH] Bug 9043: The comma (,) should be kept to separate > multi-valuated prefs > >The prefs language and opaclanguages used the comma to separate the >different values. > >The new prefs OpacAdvSearchMoreOptions and OpacAdvSearchOptions should >do the same. > >To reproduce the issue: update the language pref (or opaclanguages) and >refresh the page. >=> The pref values are not checked anymore and the language selection >(bottom of the page) does not appear. > >Test plan: >1/ Verify that the behavior described above is fixed. >2/ Verify that the original test plan of bug 9043 still passes. > >Note: The 2 OpacAdvSearchMoreOptions and OpacAdvSearchOptions pref >values are overwritten but the feature have just been pushed recently. >It should not affect a production environment. >--- > admin/preferences.pl | 2 +- > installer/data/mysql/sysprefs.sql | 4 ++-- > installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ > opac/opac-search.pl | 4 ++-- > svc/config/systempreferences | 2 +- > 5 files changed, 20 insertions(+), 6 deletions(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 00cf115..f791095 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -106,7 +106,7 @@ sub _get_chunk { > keys %{ $options{'choices'} } > ]; > } elsif ( $options{'multiple'} ) { >- my @values = split /\|/, $value; >+ my @values = split /,/, $value; > $chunk->{type} = 'multiple'; > $chunk->{CHOICES} = [ > sort { $a->{'text'} cmp $b->{'text'} } >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 097f609..4fb8cbd 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -229,8 +229,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'), > ('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'), > ('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'), >-('OpacAdvSearchMoreOptions','pubdate|itemtype|language|subtype|sorting|location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'), >-('OpacAdvSearchOptions','pubdate|itemtype|language|sorting|location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'), >+('OpacAdvSearchMoreOptions','pubdate,itemtype,language,subtype,sorting,location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'), >+('OpacAdvSearchOptions','pubdate,itemtype,language,sorting,location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'), > ('OPACAllowHoldDateInFuture','0','','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','YesNo'), > ('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'), > ('OpacAllowSharingPrivateLists','0',NULL,'If set, allows opac users to share private lists with other patrons','YesNo'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 3542685..a4a4220 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9505,6 +9505,20 @@ CREATE TABLE borrower_sync ( > SetVersion($DBversion); > } > >+$DBversion = "3.17.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do(q{ >+ UPDATE systempreferences SET value = 'pubdate,itemtype,language,sorting,location' WHERE variable='OpacAdvSearchOptions' >+ }); >+ >+ $dbh->do(q{ >+ UPDATE systempreferences SET value = 'pubdate,itemtype,language,subtype,sorting,location' WHERE variable='OpacAdvSearchMoreOptions' >+ }); >+ >+ print "Upgrade to $DBversion done (Bug 9043 - Update the values for OpacAdvSearchOptions and OpacAdvSearchOptions)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 86d0a57..e01193a 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -307,8 +307,8 @@ if ( $template_type && $template_type eq 'advsearch' ) { > > } > >- my @advsearch_limits = split /\|/, C4::Context->preference('OpacAdvSearchOptions'); >- my @advsearch_more_limits = split /\|/, >+ my @advsearch_limits = split /,/, C4::Context->preference('OpacAdvSearchOptions'); >+ my @advsearch_more_limits = split /,/, > C4::Context->preference('OpacAdvSearchMoreOptions'); > $template->param( > uc( C4::Context->preference("marcflavour") ) => 1, # we already did this for UNIMARC >diff --git a/svc/config/systempreferences b/svc/config/systempreferences >index 6fceb97..deeca51 100755 >--- a/svc/config/systempreferences >+++ b/svc/config/systempreferences >@@ -95,7 +95,7 @@ sub set_preferences { > > next if ( !defined( $pref ) ); > >- my $value = join( '|', $query->param( $param ) ); >+ my $value = join( ',', $query->param( $param ) ); > > C4::Context->set_preference( $pref, $value ); > logaction( 'SYSTEMPREFERENCE', 'MODIFY', undef, $pref . " | " . $value ); >-- >2.1.0
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 9043
:
13385
|
13858
|
15312
|
15328
|
15329
|
15546
|
15547
|
15792
|
19150
|
19151
|
20316
|
20317
|
20318
|
20717
|
20718
|
21643
|
21644
|
21645
|
27524
|
27525
|
27526
|
29005
|
29006
|
29007
|
29914
|
29915
|
29916
|
29945
|
29946
|
30183
|
30184
|
30185
|
30186
|
30967
|
30968
|
30969
|
31170
|
31557
|
31558
|
31559
|
31560
|
31561
|
33428
|
33429
|
33430
|
33431
|
33432
|
33617
|
33620
|
33947