Permalink
Browse files

Making modParams work with non-array values.

All but true, false, null will replace the parameter now.
This allows modification of string and object parameters.
  • Loading branch information...
1 parent c5c2859 commit 39b1203e9a67b3b752377ad0893b571987be0644 @markstory markstory committed Oct 9, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/Cake/Utility/ObjectCollection.php
@@ -117,7 +117,7 @@ public function trigger($callback, $params = array(), $options = array()) {
(is_array($options['breakOn']) && in_array($result, $options['breakOn'], true)))
) {
return $result;
- } elseif ($options['modParams'] !== false && is_array($result)) {
+ } elseif ($options['modParams'] !== false && !in_array($result, array(true, false, null), true)) {
$params[$options['modParams']] = $result;
}
}
@@ -303,5 +303,4 @@ public static function normalizeObjectArray($objects) {
}
return $normal;
}
-
}

0 comments on commit 39b1203

Please sign in to comment.