X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FCore%2FSettingsBag.php;h=66a663e93bad56665d78bfdf46f5fd6b42b3759f;hb=c7e28a0e3b4949f1dd7fe0077dcaf282c103fc11;hp=14289499244f2cfe8061e2704c0909815102716c;hpb=4746c08edf59da5e16c507cc43b366e23f1b9c6a;p=civicrm-core.git diff --git a/Civi/Core/SettingsBag.php b/Civi/Core/SettingsBag.php index 1428949924..66a663e93b 100644 --- a/Civi/Core/SettingsBag.php +++ b/Civi/Core/SettingsBag.php @@ -352,7 +352,11 @@ class SettingsBag { } $dao->find(TRUE); - if (isset($metadata['on_change']) && !($value == 0 && ($dao->value === NULL || unserialize($dao->value) == 0))) { + // Call 'on_change' listeners. It would be nice to only fire when there's + // a genuine change in the data. However, PHP developers have mixed + // expectations about whether 0, '0', '', NULL, and FALSE represent the same + // value, so there's no universal way to determine if a change is genuine. + if (isset($metadata['on_change'])) { foreach ($metadata['on_change'] as $callback) { call_user_func( \Civi\Core\Resolver::singleton()->get($callback),