Verified Commit 4c02e4b2 authored by Damien's avatar Damien

FEAT #11902 TIME 1:00 Fix reconcile when already signed

parent ee4d7c4b
......@@ -920,6 +920,11 @@ class ActionMethodController
if (!empty($storeResult['errors'])) {
return ['errors' => ["[storeResourceOnDocServer] {$storeResult['errors']}"]];
}
$alreadySigned = AdrModel::getDocuments(['select' => [1], 'where' => ['type = ?', 'res_id = ?', 'version = ?'], 'data' => ['SIGN', $args['data']['resId'], $targetResource['version']]]);
if (!empty($alreadySigned)) {
AdrModel::deleteDocumentAdr(['where' => ['res_id = ?', 'type in (?)', 'version = ?'], 'data' => [$args['data']['resId'], ['SIGN', 'TNL'], $targetResource['version']]]);
}
AdrModel::createDocumentAdr([
'resId' => $args['data']['resId'],
'type' => 'SIGN',
......@@ -929,7 +934,6 @@ class ActionMethodController
'version' => $targetResource['version'],
'fingerprint' => $storeResult['fingerPrint']
]);
} else {
$id = StoreController::storeAttachment([
'encodedFile' => base64_encode(file_get_contents($pathToDocument)),
......
......@@ -1488,10 +1488,10 @@ class PreProcessActionController
}
if (empty($resource['filename'])) {
$resourcesInformation['error'][] = ['alt_identifier' => $resource['alt_identifier'], 'res_id' => $resId, 'reason' => 'noFilename'];
$resourcesInformation['error'][] = ['alt_identifier' => $resource['alt_identifier'], 'res_id' => $resId, 'reason' => 'noFile'];
continue;
}
$resourcesInformation['success'][] = ['alt_identifier' => $resource['alt_identifier'], 'res_id' => $resId];
}
......
Markdown is supported
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