Verified Commit 36192287 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Fix error when no Uri of attachment on binaryDataObject

parent d0759980
......@@ -118,28 +118,6 @@ class ArchiveTransferRequest extends abstractMessage
if (isset($binaryDataObjects) && is_array($binaryDataObjects) && !empty($binaryDataObjects)) {
foreach ($binaryDataObjects as $binaryDataObject) {
$dataObjectId = $binaryDataObject->id;
// Use attachment to create local file with uri access
if (isset($binaryDataObject->attachment)) {
$attachment = $binaryDataObject->attachment;
if (!empty($attachment->value)) {
$binaryDataObject->uri = null;
} elseif (isset($attachment->filename)) { // Non compliant with SEDA2 but...
$binaryDataObject->uri = $attachment->filename;
} elseif (isset($attachment->uri)) { // Non compliant with SEDA2 but...
$binaryDataObject->uri = $attachment->uri;
}
unset($binaryDataObject->attachment);
}
if (!isset($binaryDataObject->uri)) {
$this->sendError("211", "Le document '$dataObjectId' n'a pas été trouvé.");
continue;
}
$message->size += $binaryDataObject->size;
}
}
......@@ -418,7 +396,7 @@ class ArchiveTransferRequest extends abstractMessage
$puid = $binaryDataObject->formatIdentification->formatId;
if (count($allowedFormats) && !in_array($puid, $allowedFormats)) {
$this->sendError("307", "Le format du document '".$binaryDataObject->uri."' ".$puid." n'est pas autorisé par l'accord de versement.");
$this->sendError("307", "Le format du document '".$binaryDataObject->id."' ".$puid." n'est pas autorisé par l'accord de versement.");
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment