Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix looping issue in Component loading.

Add failure condition to test suite.

Apple -> Orange -> Banana -> Apple is now the chain
in the testsuite.

Fixes #2168
  • Loading branch information...
commit 7b023bca12118f387e2b38454b2b148691c5a0f7 1 parent adb5be6
@markstory markstory authored
View
6 cake/libs/controller/component.php
@@ -257,10 +257,10 @@ function _loadComponents(&$object, $parent = null) {
if (!empty($config)) {
$this->__settings[$component] = $config;
}
- }
- if (isset($object->{$component}->components) && is_array($object->{$component}->components) && (!isset($object->{$component}->{$parent}))) {
- $this->_loadComponents($object->{$component}, $component);
+ if (isset($object->{$component}->components) && is_array($object->{$component}->components) && (!isset($object->{$component}->{$parent}))) {
+ $this->_loadComponents($object->{$component}, $component);
+ }
}
}
}
View
8 cake/tests/cases/libs/controller/component.test.php
@@ -228,6 +228,14 @@ class BananaComponent extends Object {
var $testField = 'BananaField';
/**
+ * components property
+ *
+ * @var array
+ * @access public
+ */
+ var $components = array('Apple');
+
+/**
* startup method
*
* @param Controller $controller
Please sign in to comment.
Something went wrong with that request. Please try again.