Bug 8657 - Default sort by call number does not work
If you choose to sort search results in the OPAC or staff client by call number by default, the wrong value will be saved by the system preferences editor. It should be "call_number" instead of "callnumber." This patch corrects the pref file and updates the database in cases where defaultSortField or OPACdefaultSortField are set to the incorrect value for call number sort. To test: Set defaultSortField and/or OPACdefaultSortField to "call number" and perform a search. Results will be sorted by relevance. Apply the patch, update the database, and search again. Results should now be sorted by call number. Signed-off-by: Liz Rea <wizzyrea@gmail.com> with the caveat that this will not fix the issue unless the sort order is first set to descending and back to ascending per bug 8012. However, with the sort order set to a proper sort value, this patch does fix the issue. Conflicts: installer/data/mysql/updatedatabase.pl Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
parent
81af4d3f59
commit
d7d39aaebe
|
|
@ -5255,6 +5255,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
|
|||
SetVersion($DBversion);
|
||||
}
|
||||
|
||||
$DBversion = "3.08.04.001";
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("UPDATE systempreferences SET value = 'call_number' WHERE variable = 'defaultSortField' AND value = 'callnumber'");
|
||||
$dbh->do("UPDATE systempreferences SET value = 'call_number' WHERE variable = 'OPACdefaultSortField' AND value = 'callnumber'");
|
||||
print "Upgrade to $DBversion done (Bug 8657 - Default sort by call number does not work. Correcting system preference value.)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
=head1 FUNCTIONS
|
||||
|
||||
=head2 TableExists($table)
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ Searching:
|
|||
choices:
|
||||
relevance: relevance
|
||||
popularity: total number of checkouts
|
||||
callnumber: call number
|
||||
call_number: call number
|
||||
pubdate: date of publication
|
||||
acqdate: date added
|
||||
title: title
|
||||
|
|
@ -131,7 +131,7 @@ Searching:
|
|||
choices:
|
||||
relevance: relevance
|
||||
popularity: total number of checkouts
|
||||
callnumber: call number
|
||||
call_number: call number
|
||||
pubdate: date of publication
|
||||
acqdate: date added
|
||||
title: title
|
||||
|
|
|
|||
Loading…
Reference in New Issue