mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 19:54:24 +02:00
Fix issue processwire/processwire-issues#953
This commit is contained in:
@@ -490,7 +490,8 @@ class WireHooks {
|
|||||||
*/
|
*/
|
||||||
public function addHook(Wire $object, $method, $toObject, $toMethod = null, $options = array()) {
|
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);
|
return $this->addHooks($object, $method, $toObject, $toMethod, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -740,6 +741,7 @@ class WireHooks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
$options['noAddHooks'] = true; // prevent addHook() from calling addHooks() again
|
||||||
|
|
||||||
foreach($methods as $method) {
|
foreach($methods as $method) {
|
||||||
$method = trim($method);
|
$method = trim($method);
|
||||||
|
Reference in New Issue
Block a user