Browse Source

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.

mark_story 14 years ago
parent
commit
39b1203e9a
1 changed files with 1 additions and 2 deletions
  1. 1 2
      lib/Cake/Utility/ObjectCollection.php

+ 1 - 2
lib/Cake/Utility/ObjectCollection.php

@@ -117,7 +117,7 @@ abstract class ObjectCollection {
 				(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 @@ abstract class ObjectCollection {
 		}
 		return $normal;
 	}
-
 }