CRM-21568 - Move emptiness judgments from SettingsBag::setDb to InnoDBIndexer
authorTim Otten <totten@civicrm.org>
Sat, 16 Dec 2017 20:26:09 +0000 (13:26 -0700)
committerTim Otten <totten@civicrm.org>
Sat, 16 Dec 2017 20:49:43 +0000 (13:49 -0700)
commit38e5457ebd3b37e96ee99d5afd3e49634ab3e135
tree58210c2c610a6060e507954ddd9e63eb02e1d55b
parent07cd5d66af83e516365784210f302b60e4e597c1
CRM-21568 - Move emptiness judgments from SettingsBag::setDb to InnoDBIndexer

The `SettingsBag::setDb()` function calls any `on_change` listeners.  It
originally used "dumb on change" behavior (where it calls the listeners
without comparing values).  CRM-19610 had an issue where the `InnoDBIndexer`
was running a bit too often, so they tried to resolve it by
making the `SettingsBag::setDb()` more clever.

Unfortunately, that's been a bit bouncy, and the cleverness depends on one's
particular interpretation of 0 vs '0' vs '' vs NULL vs FALSE.

Before
------
All on-change listeners may be skipped if there's particular mix of emptiness
in the old/new values.

After
-----
The on-change listeners always fire. However, the specific listener
involved with CRM-19610 will now ignore some insignificant changes.

Related discussion: https://github.com/civicrm/civicrm-core/pull/11417

----------------------------------------
* CRM-21568:
  https://issues.civicrm.org/jira/browse/CRM-21568
* CRM-19610:
  https://issues.civicrm.org/jira/browse/CRM-19610
CRM/Core/InnoDBIndexer.php
Civi/Core/SettingsBag.php