From fa8356d7291a73b018e0479f989b42dc98f554c9 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 10:38:33 +0200 Subject: [PATCH] in removeWorkflow() remove records from tblWorkflowLog before tblWorkflowDocumentContent --- SeedDMS_Core/Core/inc.ClassDocument.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 9345e56d2..7e216019c 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -4617,15 +4617,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ $currentstate = $this->getWorkflowState(); if(!$currentstate || SeedDMS_Core_DMS::checkIfEqual($this->_workflow->getInitState(), $currentstate) || $unlink == true) { $db->startTransaction(); - $queryStr= - "DELETE FROM `tblWorkflowDocumentContent` WHERE " - ."`version`='".$this->_version."' " - ." AND `document` = '". $this->_document->getID() ."' " - ." AND `workflow` = '". $this->_workflow->getID() ."' "; - if (!$db->getResult($queryStr)) { - $db->rollbackTransaction(); - return false; - } if(!$unlink) { $queryStr= "DELETE FROM `tblWorkflowLog` WHERE " @@ -4637,6 +4628,15 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ return false; } } + $queryStr= + "DELETE FROM `tblWorkflowDocumentContent` WHERE " + ."`version`='".$this->_version."' " + ." AND `document` = '". $this->_document->getID() ."' " + ." AND `workflow` = '". $this->_workflow->getID() ."' "; + if (!$db->getResult($queryStr)) { + $db->rollbackTransaction(); + return false; + } $this->_workflow = null; $this->_workflowState = null; $this->verifyStatus(false, $user, 'Workflow removed');