Skip to content

Commit

Permalink
Port local changes to VuFind 9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
David Maus committed Jan 2, 2024
1 parent c3ca188 commit d789621
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
31 changes: 26 additions & 5 deletions module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,9 @@ protected function getOpenUrlFormat()
$formats = $this->getFormats();
if (in_array('Book', $formats) || in_array('eBook', $formats)) {
return 'Book';
} elseif (in_array('Article', $formats)) {
} elseif (in_array('Article', $formats) || in_array('electronic Article', $formats)) {
return 'Article';
} elseif (in_array('Journal', $formats)) {
} elseif (in_array('Journal', $formats) || in_array('eJournal', $formats)) {
return 'Journal';
} elseif (strlen($this->getCleanISSN()) > 0) {
// If the record has an ISSN and we have not already
Expand Down Expand Up @@ -1210,7 +1210,14 @@ public function getSeries()
*/
public function getShortTitle()
{
return $this->fields['title_short'] ?? '';
if (array_key_exists('title_short', $this->fields)) {
if (is_array($this->fields['title_short'])) {
$title = $this->fields['title_short'][0];
} else {
$title = $this->fields['title_short'];
}
}
return $title ?? '';
}

/**
Expand All @@ -1231,7 +1238,14 @@ public function getSource()
*/
public function getSubtitle()
{
return $this->fields['title_sub'] ?? '';
if (array_key_exists('title_sub', $this->fields)) {
if (is_array($this->fields['title_sub'])) {
$subtitle = $this->fields['title_sub'][0];
} else {
$subtitle = $this->fields['title_sub'];
}
}
return $subtitle ?? '';
}

/**
Expand Down Expand Up @@ -1336,7 +1350,14 @@ public function getThumbnail($size = 'small')
*/
public function getTitle()
{
return $this->fields['title'] ?? '';
if (array_key_exists('title', $this->fields)) {
if (is_array($this->fields['title'])) {
$title = $this->fields['title'][0];
} else {
$title = $this->fields['title'];
}
}
return $title ?? '';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ public function getCursorMark()
return $this->response['nextCursorMark'] ?? '';
}

/**
* Get response header.
*
* @return array
*/
public function getResponseHeader()
{
return $this->response['responseHeader'] ?? [];
}

/**
* Get raw Solr input parameters from the response.
*
Expand Down

0 comments on commit d789621

Please sign in to comment.