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

Upgrade script support for fixing WorldCat author index.

parent 976eef33
No related merge requests found
...@@ -882,6 +882,18 @@ class Upgrade ...@@ -882,6 +882,18 @@ class Upgrade
); );
$this->applyOldSettings('WorldCat.ini', $groups); $this->applyOldSettings('WorldCat.ini', $groups);
// we need to fix an obsolete search setting for authors
foreach (array('Basic_Searches', 'Advanced_Searches') as $section) {
$new = array();
foreach ($this->newConfigs['WorldCat.ini'][$section] as $k => $v) {
if ($k == 'srw.au:srw.pn:srw.cn') {
$k = 'srw.au';
}
$new[$k] = $v;
}
$this->newConfigs['WorldCat.ini'][$section] = $new;
}
// save the file // save the file
$this->saveModifiedConfig('WorldCat.ini'); $this->saveModifiedConfig('WorldCat.ini');
} }
......
; This section contains global settings affecting search behavior.
[General]
; This setting controls the default sort order of search results; the selected
; option should be one of the options present in the [Sorting] section below.
default_sort = relevance
; This section shows which search types will display in the basic search box at
; the top of WorldCat pages. The name of each setting below corresponds with one
; or more indices defined in the WorldCat API (multiple values are separated by
; colons). The value of each setting is the text to display on screen. All
; on-screen text will be run through the translator, so be sure to update language
; files if necessary. The order of these settings will be maintained in the
; drop-down list in the UI.
;
; For a complete list of legal values, see the SRU Explain page here:
; http://worldcat.org/webservices/catalog/
[Basic_Searches]
srw.kw = "All Fields"
srw.ti:srw.se = Title
srw.au:srw.pn:srw.cn = Author
srw.su = Subject
srw.dd:srw.lc = "Call Number"
srw.bn:srw.in = "ISBN/ISSN"
; This section defines which search options will be included on the advanced
; search screen. All the notes above [Basic_Searches] also apply here.
[Advanced_Searches]
srw.kw = adv_search_all
srw.ti:srw.se = adv_search_title
srw.au:srw.pn:srw.cn = adv_search_author
srw.su = adv_search_subject
srw.dd:srw.lc = adv_search_callnumber
srw.bn:srw.in = adv_search_isn
srw.pb = adv_search_publisher
srw.se = adv_search_series
srw.yr = adv_search_year
; This section defines the sort options available on WorldCat search results.
; Values on the left of the equal sign are WorldCat API sort values. Values
; on the right of the equal sign are text that will be run through the
; translation module and displayed on screen.
[Sorting]
relevance = sort_relevance
Date,,0 = sort_year
Date = "sort_year asc"
Author = sort_author
Title = sort_title
[WorldCat]
apiKey = fake
\ No newline at end of file
...@@ -304,6 +304,26 @@ class UpgradeTest extends \VuFindTest\Unit\TestCase ...@@ -304,6 +304,26 @@ class UpgradeTest extends \VuFindTest\Unit\TestCase
); );
} }
/**
* Test WorldCat-specific upgrades.
*
* @return void
*/
public function testWorldCatUpgrades()
{
$upgrader = $this->getUpgrader('worldcatupgrades');
$upgrader->run();
$results = $upgrader->getNewConfigs();
$this->assertEquals(
'Author',
$results['WorldCat.ini']['Basic_Searches']['srw.au']
);
$this->assertEquals(
'adv_search_author',
$results['WorldCat.ini']['Advanced_Searches']['srw.au']
);
}
/** /**
* Test "meaningful line" detection in SolrMarc properties files. * Test "meaningful line" detection in SolrMarc properties files.
* *
......
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