Skip to content

Commit

Permalink
[BUGFIX] Iterate over metadata ids only if there are any metadata sec…
Browse files Browse the repository at this point in the history
…tions (#1356)

Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer authored Oct 21, 2024
1 parent 3057b40 commit 630d80d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Classes/Common/MetsDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,18 +595,20 @@ private function processMetadataSections(string $id, int $cPid, array $metadata)

$metadata['type'] = $this->getLogicalUnitType($id);

foreach ($mdIds as $dmdId) {
$mdSectionType = $this->mdSec[$dmdId]['section'];

if ($this->hasMetadataSection($metadataSections, $mdSectionType, 'dmdSec')) {
continue;
}

if (!$this->extractAndProcessMetadata($dmdId, $mdSectionType, $metadata, $cPid, $metadataSections)) {
continue;
if (!empty($this->mdSec)) {
foreach ($mdIds as $dmdId) {
$mdSectionType = $this->mdSec[$dmdId]['section'];

if ($this->hasMetadataSection($metadataSections, $mdSectionType, 'dmdSec')) {
continue;
}

if (!$this->extractAndProcessMetadata($dmdId, $mdSectionType, $metadata, $cPid, $metadataSections)) {
continue;
}

$metadataSections[] = $mdSectionType;
}

$metadataSections[] = $mdSectionType;
}

// Files are not expected to reference a dmdSec
Expand Down

0 comments on commit 630d80d

Please sign in to comment.