Browse Source

Prefer ORDER label over year(_sorting) fallback in volume sorting.

The ORDER label is optional in the LOGICAL structMap. If it is present,
it should be used for volume sorting.

Using the year or the year_sorting will fail, if multiple volumes have
the same value.
pull/603/head
Alexander Bigga 2 years ago
parent
commit
db7285a2aa
  1. 6
      Classes/Common/Document.php
  2. 1
      Classes/Common/MetsDocument.php

6
Classes/Common/Document.php

@ -1169,7 +1169,10 @@ abstract class Document
$metadata['volume'] = $metadata['year'];
}
if (empty($metadata['volume_sorting'][0])) {
if (!empty($metadata['year_sorting'][0])) {
// If mets ORDER label is given it is prefered over year_sorting and year.
if (!empty($metadata['mets_order'][0])) {
$metadata['volume_sorting'][0] = $metadata['mets_order'][0];
} elseif (!empty($metadata['year_sorting'][0])) {
$metadata['volume_sorting'][0] = $metadata['year_sorting'][0];
} elseif (!empty($metadata['year'][0])) {
$metadata['volume_sorting'][0] = $metadata['year'][0];
@ -1249,6 +1252,7 @@ abstract class Document
'collections' => $metadata['collection'],
'mets_label' => $metadata['mets_label'][0],
'mets_orderlabel' => $metadata['mets_orderlabel'][0],
'mets_order' => $metadata['mets_order'][0],
'owner' => $metadata['owner'][0],
'solrcore' => $core,
'status' => 0,

1
Classes/Common/MetsDocument.php

@ -131,6 +131,7 @@ final class MetsDocument extends Document
{
$details = $this->getLogicalStructure($id);
if (!empty($details)) {
$metadata['mets_order'][0] = $details['order'];
$metadata['mets_label'][0] = $details['label'];
$metadata['mets_orderlabel'][0] = $details['orderlabel'];
}

Loading…
Cancel
Save