Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.5
-
Fix Version/s: 4.3.6
-
Component/s: Core CiviCRM
-
Labels:None
Description
(Observed when running CiviHR – a setup in which multiple modules/extensions define hooks)
1. Suppose we have two implementations of hook_civicrm_config (eg a_civicrm_config and b_civicrm_config)
2. Suppose that a_civicrm_config triggers (either directly or indirectly) hook_civicrm_optionValues (e.g. a_civicrm_optionValues)
3. Problem: a_civicrm_config and a_civicrm_optionValues execute (as expected) but b_civicrm_config never executes.
This is because CRM_Utils_Hook::runHooks is non-reentrant – it accepts a reference to the $civiModules array, so all concurrent invocations of runHooks use the same copy of $civiModues, but PHP only allows one implicit iterator for each array.