Skip to content
Permalink
Browse files

Fix issue where incorrect elements would be used.

If your view is using an alternate extension and you have elements
that share filenames, the incorrect element would be used.
Fixes #2082
  • Loading branch information...
markstory committed Oct 11, 2011
1 parent bc6de18 commit 049d6e4c76c767bd83a9da80872d2faed583c506
@@ -380,6 +380,9 @@ function element($name, $params = array(), $loadHelpers = false) {
break;
}
}
if ($file) {
break;
}
}
if (is_file($file)) {
@@ -487,6 +487,17 @@ function testElement() {
$this->assertPattern('/non_existant_element/', $result);
}
/**
* Test that alternate extensions work with duplicated elements.
*
* @return void
*/
function testElementExtensions() {
$this->View->ext = '.xml';
$result = $this->View->element('test_element');
$this->assertEqual(trim($result), '<p>test element</p>');
}
/**
* test that additional element viewVars don't get overwritten with helpers.
*
@@ -0,0 +1 @@
<p>test element</p>

0 comments on commit 049d6e4

Please sign in to comment.
You can’t perform that action at this time.