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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

I was able to reproduce the issue and verify that this patch corrected
the problem. Langage selection and OpacAdvSearchOptions worked
correctly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Jonathan Druart 2014-11-17 16:55:26 +01:00 committed by Tomas Cohen Arazi
parent 47e030ea75
commit dddde58967
5 changed files with 20 additions and 6 deletions

View File

@ -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'} }

View File

@ -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'),

View File

@ -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)

View File

@ -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

View File

@ -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 );