pass old value to onPostUpdateAttribute callback

This commit is contained in:
Uwe Steinmann 2022-02-25 18:38:00 +01:00
parent c9fae356b3
commit 3ad44fac0b

View File

@ -257,12 +257,13 @@ class SeedDMS_Core_Attribute { /* {{{ */
if (!$db->getResult($queryStr))
return false;
$oldvalue = $this->_value;
$this->_value = $value;
/* Check if 'onPostUpdateAttribute' callback is set */
if(isset($this->_dms->callbacks['onPostUpdateAttribute'])) {
foreach($this->_dms->callbacks['onPostUpdateAttribute'] as $callback) {
if(!call_user_func($callback[0], $callback[1], $this->_obj, $this->_attrdef, $value)) {
if(!call_user_func($callback[0], $callback[1], $this->_obj, $this->_attrdef, $value, $oldvalue)) {
}
}
}