From 3ac9ab1c9af5226f9407ac4ff840d440037a416a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 23 Jul 2013 16:05:43 -0700 Subject: [PATCH] CRM-13103 - Fix reentrant hook invocations ---------------------------------------- * CRM-13103: Hook execution terminates prematurely http://issues.civicrm.org/jira/browse/CRM-13103 --- CRM/Utils/Hook.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 6adb9d714d..628c6ead40 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -126,9 +126,13 @@ abstract class CRM_Utils_Hook { } } - function runHooks(&$civiModules, $fnSuffix, $numParams, + function runHooks($civiModules, $fnSuffix, $numParams, &$arg1, &$arg2, &$arg3, &$arg4, &$arg5 ) { + // $civiModules is *not* passed by reference because runHooks + // must be reentrant. PHP is finicky about running + // multiple loops over the same variable. The circumstances + // to reproduce the issue are pretty intricate. $result = $fResult = array(); if ($civiModules !== NULL) { -- 2.25.1