From 57520f27cf09ce621b15bc3984d87fe1779e35ef Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 27 Mar 2015 17:15:21 +0100 Subject: [PATCH] clean workflow log if document version is deleted --- SeedDMS_Core/Core/inc.ClassDocument.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index ccd75b64f..a3ff08a80 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -1486,6 +1486,12 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ return false; } + $queryStr = "DELETE FROM `tblWorkflowLog` WHERE `document` = '". $this->getID() ."' AND `version` = '" . $version->_version."'"; + if (!$db->getResult($queryStr)) { + $db->rollbackTransaction(); + return false; + } + $db->commitTransaction(); return true; } /* }}} */