mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
ac6a3023c0
commit
a5ee9976f4
@ -263,8 +263,8 @@ class Requirements {
|
|||||||
if(isset($_GET['debug_profile'])) Profiler::mark("Requirements::includeInHTML");
|
if(isset($_GET['debug_profile'])) Profiler::mark("Requirements::includeInHTML");
|
||||||
|
|
||||||
if(strpos($content, '</head') === false) {
|
if(strpos($content, '</head') === false) {
|
||||||
user_error('Requirements::includeInHTML(): No closing <head> tag found, can\'t insert Requirements', E_USER_NOTICE);
|
if(isset($_GET['debug_profile'])) Profiler::unmark("Requirements::includeInHTML");
|
||||||
return false;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
$prefix = Director::absoluteBaseURL();
|
$prefix = Director::absoluteBaseURL();
|
||||||
|
15
tests/SSViewerTest.php
Normal file
15
tests/SSViewerTest.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
1
tests/templates/SSViewerTestPartialTemplate.ss
Normal file
1
tests/templates/SSViewerTestPartialTemplate.ss
Normal file
@ -0,0 +1 @@
|
|||||||
|
Test partial template: $Var
|
Loading…
x
Reference in New Issue
Block a user