Verified Commit 193a98ef authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #16992 TIME 0:10 Error when delete connector that is not used

parent f29dbc52
......@@ -211,11 +211,13 @@ class ExternalSignatoryBookController
]);
$currentDocumentsId = array_column($workflows, 'main_document_id');
$documents = DocumentModel::get(['select' => ['typist', 'title', 'id'], 'where' => ['id in (?)'], 'data' => [$currentDocumentsId]]);
foreach ($documents as $document) {
$process = WorkflowController::interruptProcess(['id' => $document['id'], 'documentTypist' => $document['typist'], 'documentTitle' => $document['title']]);
if (!empty($process['errors'])) {
return $response->withStatus(400)->withJson(['errors' => $process['errors']]);
if (!empty($currentDocumentsId)) {
$documents = DocumentModel::get(['select' => ['typist', 'title', 'id'], 'where' => ['id in (?)'], 'data' => [$currentDocumentsId]]);
foreach ($documents as $document) {
$process = WorkflowController::interruptProcess(['id' => $document['id'], 'documentTypist' => $document['typist'], 'documentTitle' => $document['title']]);
if (!empty($process['errors'])) {
return $response->withStatus(400)->withJson(['errors' => $process['errors']]);
}
}
}
......
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