Only ensure that we check if the value passed is 0 and the db value is 0 or NULL
authorSeamus Lee <seamuslee001@gmail.com>
Sun, 11 Jun 2017 04:23:49 +0000 (14:23 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 11 Jun 2017 22:14:23 +0000 (08:14 +1000)
Civi/Core/SettingsBag.php

index 8f623da29e878ef6091b7ca03e18fb778d56e88a..b117309796f4f17d436ecb26cb808f7fea9b5f02 100644 (file)
@@ -352,7 +352,7 @@ class SettingsBag {
     }
     $dao->find(TRUE);
 
-    if (isset($metadata['on_change']) && $value != 0 && !($dao->value === NULL || unserialize($dao->value) == 0)) {
+    if (isset($metadata['on_change']) && !($value === 0 && ($dao->value === NULL || unserialize($dao->value) === 0))) {
       foreach ($metadata['on_change'] as $callback) {
         call_user_func(
           \Civi\Core\Resolver::singleton()->get($callback),