1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-15 11:14:12 +02:00
This commit is contained in:
Ryan Cramer
2019-08-07 06:00:11 -04:00
parent 481eb7c545
commit 81c745c5ad

View File

@@ -490,7 +490,8 @@ class WireHooks {
*/
public function addHook(Wire $object, $method, $toObject, $toMethod = null, $options = array()) {
if(is_array($method) || strpos($method, ',') !== false) {
if(empty($options['noAddHooks']) && (is_array($method) || strpos($method, ',') !== false)) {
// potentially multiple methods to hook in $method argument
return $this->addHooks($object, $method, $toObject, $toMethod, $options);
}
@@ -740,6 +741,7 @@ class WireHooks {
}
$result = array();
$options['noAddHooks'] = true; // prevent addHook() from calling addHooks() again
foreach($methods as $method) {
$method = trim($method);