Skip to content

Commit d2f5af3

Browse files
michaelkubinamichaelkubina-subhhsebastian-meyer
authored
[BUGFIX] Fix adding empty xpath results to metadata array (kitodo#1564)
Co-authored-by: Michael Kubina <[email protected]> Co-authored-by: Sebastian Meyer <[email protected]>
1 parent d982732 commit d2f5af3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Classes/Common/MetsDocument.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,9 @@ private function setMetadataFieldValues(array $resArray, DOMXPath $domXPath, DOM
850850
}
851851
}
852852
} elseif (!($values instanceof DOMNodeList)) {
853-
$metadata[$resArray['index_name']] = [trim((string) $values)];
853+
if (!empty($values)) {
854+
$metadata[$resArray['index_name']] = [trim((string) $values)];
855+
}
854856
}
855857
}
856858
}

0 commit comments

Comments
 (0)