From c6924de06515aa47629b74b06aea3297438f24af Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 25 Mar 2020 08:05:41 +0100 Subject: [PATCH] init $lasterror before calling hook --- SeedDMS_Core/Core/inc.ClassDocument.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 06fd32e4e..e825843b3 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -1987,6 +1987,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ * @return bool|mixed */ function removeContent($version) { /* {{{ */ + $this->_dms->lasterror = ''; + /* Check if 'onPreRemoveDocument' callback is set */ if(isset($this->_dms->callbacks['onPreRemoveContent'])) { foreach($this->_dms->callbacks['onPreRemoveContent'] as $callback) { @@ -2272,6 +2274,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ */ function remove() { /* {{{ */ $db = $this->_dms->getDB(); + $this->_dms->lasterror = ''; /* Check if 'onPreRemoveDocument' callback is set */ if(isset($this->_dms->callbacks['onPreRemoveDocument'])) {