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

More conservative Summon thumbnail behavior.

parent 617555e8
No related merge requests found
...@@ -420,13 +420,21 @@ class Summon extends SolrDefault ...@@ -420,13 +420,21 @@ class Summon extends SolrDefault
*/ */
public function getThumbnail($size = 'small') public function getThumbnail($size = 'small')
{ {
// Support thumbnails embedded in the Summon record:
if ($size === 'small' && isset($this->fields['thumbnail_s'][0])) {
return array('proxy' => $this->fields['thumbnail_s'][0]);
} else if (isset($this->fields['thumbnail_m'][0])) {
return array('proxy' => $this->fields['thumbnail_m'][0]);
}
$params = parent::getThumbnail($size); $params = parent::getThumbnail($size);
// Support thumbnails embedded in the Summon record when no unique identifier
// is found... (We don't use them in cases where we have an identifier, since
// we want to allow these to be passed to configured external services).
if (!isset($params['oclc']) && !isset($params['issn'])
&& !isset($params['isbn']) && !isset($params['upc'])
) {
if ($size === 'small' && isset($this->fields['thumbnail_s'][0])) {
return array('proxy' => $this->fields['thumbnail_s'][0]);
} else if (isset($this->fields['thumbnail_m'][0])) {
return array('proxy' => $this->fields['thumbnail_m'][0]);
}
}
$formats = $this->getFormats(); $formats = $this->getFormats();
if (!empty($formats)) { if (!empty($formats)) {
$params['contenttype'] = $formats[0]; $params['contenttype'] = $formats[0];
......
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