Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.0, 4.4.0, 4.5, 4.6
-
Fix Version/s: 4.5.1
-
Component/s: Extension System
-
Labels:None
-
Documentation Required?:None
Description
The old structure allowed for possible multiplication of $fResult in $result when a specific $fnSuffix hook was implemented in one module, but not in another.
We only want to add $fResult to $result if $fnName exists, so moved the array_merge() into that if-statement. Furthermore, if $numParams is not case-specified in the switch, at the array_merge(), $fResult could hold the result from a previous module (because in the default case $fResult is not being set), so we have to initialize $fResult to an empty array in the foreach().
See pull-request: https://github.com/civicrm/civicrm-core/pull/4166