Skip to content

Commit

Permalink
Merge pull request #755 from albig/prepare-3.3.3
Browse files Browse the repository at this point in the history
Prepare Release 3.3.3
  • Loading branch information
Alexander Bigga authored Jan 11, 2022
2 parents 8d3ff8e + a3d4f15 commit b9df5c6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
12 changes: 9 additions & 3 deletions Classes/Common/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,14 @@ class_exists($class)
*/
private function getTextFormat($fileContent)
{
// Get the root element's name as text format.
return strtoupper(Helper::getXmlFileAsString($fileContent)->getName());
$xml = Helper::getXmlFileAsString($fileContent);

if ($xml !== false) {
// Get the root element's name as text format.
return strtoupper($xml->getName());
} else {
return '';
}
}

/**
Expand Down Expand Up @@ -1130,7 +1136,7 @@ public function save($pid = 0, $core = 0, $owner = null)

// Get UID for owner.
if (empty($owner)) {
$owner = empty($metadata['owner'][0]) ? $metadata['owner'][0] : 'default';
$owner = $metadata['owner'][0] ? : 'default';
}
if (!MathUtility::canBeInterpretedAsInteger($owner)) {
$result = $queryBuilder
Expand Down
18 changes: 12 additions & 6 deletions Classes/Common/MetsDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,11 @@ class_exists($class)

$allResults = $result->fetchAll();

foreach ($allResults as $resArray) {
if (!in_array($resArray['index_name'], $metadata['collection'])) {
$metadata['collection'][] = $resArray['index_name'];
if (is_array($allResults)) {
foreach ($allResults as $resArray) {
if (!in_array($resArray['index_name'], $metadata['collection'])) {
$metadata['collection'][] = $resArray['index_name'];
}
}
}

Expand All @@ -647,11 +649,15 @@ class_exists($class)
$queryBuilder->expr()->eq('tx_dlf_documents.pid', intval($cPid)),
$queryBuilder->expr()->eq('tx_dlf_documents.uid', intval($this->uid))
)
->setMaxResults(1)
->execute();

$resArray = $result->fetch();

$metadata['owner'][0] = $resArray['owner'];
if ($resArray = $result->fetch()) {
// Only overwrite owner with found value, if not already set.
if (empty($metadata['owner'][0]) && isset($resArray['owner'])) {
$metadata['owner'][0] = $resArray['owner'];
}
}
}
// Extract metadata only from first supported dmdSec.
$hasSupportedMetadata = true;
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$EM_CONF[$_EXTKEY] = [
'title' => 'Kitodo.Presentation',
'description' => 'Base plugins, modules, services and API of the Digital Library Framework. It is part of the community-based Kitodo Digitization Suite.',
'version' => '3.3.2',
'version' => '3.3.3',
'category' => 'misc',
'constraints' => [
'depends' => [
Expand Down

0 comments on commit b9df5c6

Please sign in to comment.