diff --git a/SeedDMS_Core/Core/inc.ClassObject.php b/SeedDMS_Core/Core/inc.ClassObject.php index 0f7b90eb8..a2f0b1ae4 100644 --- a/SeedDMS_Core/Core/inc.ClassObject.php +++ b/SeedDMS_Core/Core/inc.ClassObject.php @@ -298,6 +298,7 @@ class SeedDMS_Core_Object { /* {{{ */ $this->getAttributes(); } if(isset($this->_attributes[$attrdef->getId()])) { + $oldvalue = $this->_attributes[$attrdef->getId()]->getValue(); switch(get_class($this)) { case $this->_dms->getClassname('document'): $queryStr = "DELETE FROM `tblDocumentAttributes` WHERE `document`=".$this->_id." AND `attrdef`=".$attrdef->getId(); @@ -315,6 +316,14 @@ class SeedDMS_Core_Object { /* {{{ */ if (!$res) return false; + /* Check if 'onPostRemoveAttribute' callback is set */ + if(isset($this->_dms->callbacks['onPostRemoveAttribute'])) { + foreach($this->_dms->callbacks['onPostRemoveAttribute'] as $callback) { + if(!call_user_func($callback[0], $callback[1], $this, $attrdef, $oldvalue)) { + } + } + } + unset($this->_attributes[$attrdef->getId()]); } return true; diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index c6a2273ee..b06963a7f 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -28,7 +28,7 @@ - getLastWorkflowLog() returns a workflow entry even if the workflow has ended - backport setFileType() from 6.0.x - add SeedDMS_Core_File::fileExtension() -- add callbacks on onPostUpdateAttribute and onPostAddAttribute +- add callbacks on onPostUpdateAttribute, onPostRemoveAttribute, onPostAddAttribute