BUGFIX: [Grayzag] #2676 - Fixed rendering of partial templates, broken in r58354.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@58556 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-07-21 11:59:24 +00:00
parent ac6a3023c0
commit a5ee9976f4
3 changed files with 18 additions and 2 deletions

View File

@ -263,8 +263,8 @@ class Requirements {
if(isset($_GET['debug_profile'])) Profiler::mark("Requirements::includeInHTML");
if(strpos($content, '</head') === false) {
user_error('Requirements::includeInHTML(): No closing <head> tag found, can\'t insert Requirements', E_USER_NOTICE);
return false;
if(isset($_GET['debug_profile'])) Profiler::unmark("Requirements::includeInHTML");
return $content;
}
$prefix = Director::absoluteBaseURL();

15
tests/SSViewerTest.php Normal file
View File

@ -0,0 +1,15 @@
<?php
class SSViewerTest extends SapphireTest {
/**
* Test that a template without a <head> tag still renders.
*/
function testTemplateWithoutHeadRenders() {
$data = new ArrayData(array(
'Var' => 'var value'
));
$result = $data->renderWith("SSViewerTestPartialTemplate");
$this->assertEquals('Test partial template: var value', $result);
}
}

View File

@ -0,0 +1 @@
Test partial template: $Var