Skip to content
Snippets Groups Projects
Commit 98dad53e authored by Dorian Merz's avatar Dorian Merz
Browse files

Merge branch 'instance/fid' into instance/fid_adlr

parents 169c486b 35ee9d83
No related merge requests found
...@@ -166,12 +166,17 @@ class EbscoResults implements ...@@ -166,12 +166,17 @@ class EbscoResults implements
if (!$results->isSuccess()) { if (!$results->isSuccess()) {
$this->results = false; $this->results = false;
return;
} }
$this->results = $this->sortByHits( $this->results = $this->sortByHits(
json_decode($results->getBody(), true) json_decode($results->getBody(), true)
); );
if (json_last_error() !== JSON_ERROR_NONE) { if (json_last_error() !== JSON_ERROR_NONE) {
throw new \Exception('JSON type error ' . json_last_error_msg()); $this->debug(
'JSON type error "'
. json_last_error_msg().'"'
. (empty($results->getBody()) ? '. EBSCO result was empty.' : '')
);
} }
} }
......
...@@ -54,18 +54,12 @@ class ResultFeed extends \VuFind\View\Helper\Root\ResultFeed ...@@ -54,18 +54,12 @@ class ResultFeed extends \VuFind\View\Helper\Root\ResultFeed
protected function addEntry($feed, $record) protected function addEntry($feed, $record)
{ {
$entry = $feed->createEntry(); $entry = $feed->createEntry();
$title = $record->tryMethod('getTitle'); $helper = $this->getView()->citation($record);
$publishPlace = $record->tryMethod('getPlacesOfPublication'); $recordtype = $record->getRecordType();
if (!empty($publishPlace)) { if ($recordtype == 'ai') {
$title .= ' / ' . implode(', ', $publishPlace); $title = $helper->getCitation('APAAI');
} } else {
$publisher = $record->tryMethod('getPublishers'); $title = $helper->getCitation('APA');
if (!empty($publisher) && is_array($publisher)) {
$title .= ' / ' . implode(', ', $publisher);
}
$publishDateSort = $record->tryMethod('getPublishDateSort');
if (!empty($publishDateSort)) {
$title .= ' / ' . $publishDateSort;
} }
$entry->setTitle(empty($title) ? $record->getBreadcrumb() : $title); $entry->setTitle(empty($title) ? $record->getBreadcrumb() : $title);
$serverUrl = $this->getView()->plugin('serverurl'); $serverUrl = $this->getView()->plugin('serverurl');
...@@ -85,21 +79,6 @@ class ResultFeed extends \VuFind\View\Helper\Root\ResultFeed ...@@ -85,21 +79,6 @@ class ResultFeed extends \VuFind\View\Helper\Root\ResultFeed
if (!empty($date)) { if (!empty($date)) {
$entry->setDateModified($date); $entry->setDateModified($date);
} }
$author = $record->tryMethod('getPrimaryAuthor');
if (!empty($author)) {
$entry->addAuthor(['name' => $author]);
}
/*$formats = $record->tryMethod('getFormats');
if (is_array($formats)) {
foreach ($formats as $format) {
$entry->addDCFormat($format);
}
}
$dcDate = $this->getDcDate($record);
if (!empty($dcDate)) {
$entry->setDCDate($dcDate);
}*/
$feed->addEntry($entry); $feed->addEntry($entry);
} }
......
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