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.
This commit is contained in:
Alexander Bigga 2021-03-22 21:30:05 +01:00
parent f20a9e6d56
commit db7285a2aa
2 changed files with 6 additions and 1 deletions

View File

@ -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,

View File

@ -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'];
}