Skip to content

Commit

Permalink
Moved code for parsing bad data in ISSNs. Gets deduping for 022|y fields
Browse files Browse the repository at this point in the history
working on results pages and fixes issue #63.
  • Loading branch information
Vufind System Account committed Jan 18, 2019
1 parent faf9579 commit e6bcfeb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function getDedupedEholdings($issns, $sfxNum) {
$url = $config['DedupedEholdings']['url'] . '?code=' . $code . '&function=' . $function . '&callback=vufind';

if (strlen($issns) > 0) {
$url .= '&issns="' . $issns;
$url .= '&issns=' . $issns;
}
if (strlen($sfxNum) > 0) {
$url .= '&sfx=' . $sfxNum;
Expand Down
21 changes: 21 additions & 0 deletions module/UChicago/src/UChicago/RecordDriver/SolrMarcPhoenix.php
Original file line number Diff line number Diff line change
Expand Up @@ -912,4 +912,25 @@ public function isFullText()
sfx.has_full_text
*/
}

/**
* Get an array of all ISSNs associated with the record (may be empty).
*
* @return array
*/
public function getISSNs()
{
// If ISSN is in the index, it should automatically be an array... but if
// it's not set at all, we should normalize the value to an empty array.
$rawISSNs = isset($this->fields['issn']) && is_array($this->fields['issn']) ?
$this->fields['issn'] : [];

$rawISSNs = array_map(function($val) {
return explode(' ', $val);
}, $rawISSNs);

$issns = !empty($rawISSNs) ? call_user_func_array('array_merge', $rawISSNs) : [];

return $issns;
}
}
5 changes: 1 addition & 4 deletions themes/phoenix/templates/RecordTab/holdingsils.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
$bib = $this->driver->getUniqueID();
$isSfxStub = strtolower(substr($bib, 0, 3)) == 'sfx';
$sfxNum = $isSfxStub ? substr($bib, 4) : '';
$rawISSNs = array_map(function($val) {
return explode(' ', $val);
}, $this->driver->getISSNs());
$issns = !empty($rawISSNs) ? call_user_func_array('array_merge', $rawISSNs) : [];
$issns = $this->driver->getISSNs();
$hasIssns = count($issns) > 0;

// E-resource links
Expand Down

0 comments on commit e6bcfeb

Please sign in to comment.