Skip to content
Snippets Groups Projects
Verified Commit 4c02e4b2 authored by Damien's avatar Damien
Browse files

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

parent ee4d7c4b
No related branches found
No related tags found
No related merge requests found
...@@ -920,6 +920,11 @@ class ActionMethodController ...@@ -920,6 +920,11 @@ class ActionMethodController
if (!empty($storeResult['errors'])) { if (!empty($storeResult['errors'])) {
return ['errors' => ["[storeResourceOnDocServer] {$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([ AdrModel::createDocumentAdr([
'resId' => $args['data']['resId'], 'resId' => $args['data']['resId'],
'type' => 'SIGN', 'type' => 'SIGN',
...@@ -929,7 +934,6 @@ class ActionMethodController ...@@ -929,7 +934,6 @@ class ActionMethodController
'version' => $targetResource['version'], 'version' => $targetResource['version'],
'fingerprint' => $storeResult['fingerPrint'] 'fingerprint' => $storeResult['fingerPrint']
]); ]);
} else { } else {
$id = StoreController::storeAttachment([ $id = StoreController::storeAttachment([
'encodedFile' => base64_encode(file_get_contents($pathToDocument)), 'encodedFile' => base64_encode(file_get_contents($pathToDocument)),
......
...@@ -1488,10 +1488,10 @@ class PreProcessActionController ...@@ -1488,10 +1488,10 @@ class PreProcessActionController
} }
if (empty($resource['filename'])) { 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; continue;
} }
$resourcesInformation['success'][] = ['alt_identifier' => $resource['alt_identifier'], 'res_id' => $resId]; $resourcesInformation['success'][] = ['alt_identifier' => $resource['alt_identifier'], 'res_id' => $resId];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment