Skip to content
Snippets Groups Projects
Commit 61aa4a4a authored by Demian Katz's avatar Demian Katz
Browse files

Fixed call number sort configuration.

parent 1f933a2b
No related merge requests found
...@@ -151,7 +151,7 @@ title = sort_title ...@@ -151,7 +151,7 @@ title = sort_title
; [Sorting] section above. Any search type that is not listed here will be sorted ; [Sorting] section above. Any search type that is not listed here will be sorted
; using the default_sort setting in the [General] section above. ; using the default_sort setting in the [General] section above.
[DefaultSortingByType] [DefaultSortingByType]
CallNumber = callnumber CallNumber = callnumber-sort
; Each search type defined in searchspecs.yaml can have one or more "recommendations ; Each search type defined in searchspecs.yaml can have one or more "recommendations
; modules" associated with it in the following sections. These plug-ins will cause ; modules" associated with it in the following sections. These plug-ins will cause
......
...@@ -742,6 +742,19 @@ class Upgrade ...@@ -742,6 +742,19 @@ class Upgrade
} }
} }
// fix call number sort settings:
if (isset($newConfig['Sorting']['callnumber'])) {
$newConfig['Sorting']['callnumber-sort']
= $newConfig['Sorting']['callnumber'];
unset($newConfig['Sorting']['callnumber']);
}
if (isset($newConfig['DefaultSortingByType'])) {
foreach ($newConfig['DefaultSortingByType'] as & $v) {
if ($v === 'callnumber') {
$v = 'callnumber-sort';
}
}
}
$this->upgradeSpellingSettings('searches.ini', ['CallNumber']); $this->upgradeSpellingSettings('searches.ini', ['CallNumber']);
// save the file // save the file
......
...@@ -137,6 +137,14 @@ class UpgradeTest extends \VuFindTest\Unit\TestCase ...@@ -137,6 +137,14 @@ class UpgradeTest extends \VuFindTest\Unit\TestCase
], ],
$results['searches.ini']['TopRecommendations'] $results['searches.ini']['TopRecommendations']
); );
$this->assertEquals(
['CallNumber' => 'callnumber-sort'],
$results['searches.ini']['DefaultSortingByType']
);
$this->assertEquals(
'sort_callnumber',
$results['searches.ini']['Sorting']['callnumber-sort']
);
$this->assertEquals( $this->assertEquals(
['SummonDatabases', 'SpellingSuggestions'], ['SummonDatabases', 'SpellingSuggestions'],
$results['Summon.ini']['General']['default_top_recommend'] $results['Summon.ini']['General']['default_top_recommend']
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment