diff --git a/config/vufind/searches.ini b/config/vufind/searches.ini index f0576f491e2b9b5ef9196c8da7bec2548936b828..b855252ebec4a11a4856ab0a2656b2e6adb0e7b0 100644 --- a/config/vufind/searches.ini +++ b/config/vufind/searches.ini @@ -151,7 +151,7 @@ title = sort_title ; [Sorting] section above. Any search type that is not listed here will be sorted ; using the default_sort setting in the [General] section above. [DefaultSortingByType] -CallNumber = callnumber +CallNumber = callnumber-sort ; 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 diff --git a/module/VuFind/src/VuFind/Config/Upgrade.php b/module/VuFind/src/VuFind/Config/Upgrade.php index 29baac4376974e5701456a73f1dd92f7a64cba88..1a1b6631c36f4bc0612240a9a597942933fbb0b7 100644 --- a/module/VuFind/src/VuFind/Config/Upgrade.php +++ b/module/VuFind/src/VuFind/Config/Upgrade.php @@ -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']); // save the file diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/UpgradeTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/UpgradeTest.php index 3600da0f165a26ee1c57308813d94e4d11d46fd5..3de75198fdff3b93a50a3a83b67e4fb75d57d468 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/UpgradeTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/UpgradeTest.php @@ -137,6 +137,14 @@ class UpgradeTest extends \VuFindTest\Unit\TestCase ], $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( ['SummonDatabases', 'SpellingSuggestions'], $results['Summon.ini']['General']['default_top_recommend']