mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Regression with <% with / %> (fixes #5656)
This commit is contained in:
parent
8a99b4f74e
commit
946495bcf5
@ -0,0 +1 @@
|
|||||||
|
$Title<% with $Item %> - <% with $Up %>$Title<% end_with %> - <% with $NestedItem %><% with $Top %>$Title<% end_with %><% end_with %><% end_with %>
|
@ -726,6 +726,16 @@ after')
|
|||||||
'A - B - C - B - A'
|
'A - B - C - B - A'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->assertEquals(
|
||||||
|
$this->render('<% include SSViewerTestIncludeScopeInheritanceWithUpAndTop Title="A" %>',
|
||||||
|
new ArrayData(array(
|
||||||
|
'Item' => new ArrayData(array(
|
||||||
|
'Title' =>'B', 'NestedItem' => new ArrayData(array('Title' => 'C'))
|
||||||
|
)))
|
||||||
|
)),
|
||||||
|
'A - A - A'
|
||||||
|
);
|
||||||
|
|
||||||
$data = new ArrayData(array(
|
$data = new ArrayData(array(
|
||||||
'Nested' => new ArrayData(array(
|
'Nested' => new ArrayData(array(
|
||||||
'Object' => new ArrayData(array('Key' => 'A'))
|
'Object' => new ArrayData(array('Key' => 'A'))
|
||||||
|
@ -558,12 +558,15 @@ class SSViewer_DataPresenter extends SSViewer_Scope {
|
|||||||
*/
|
*/
|
||||||
public function pushScope() {
|
public function pushScope() {
|
||||||
$scope = parent::pushScope();
|
$scope = parent::pushScope();
|
||||||
|
$upIndex = $this->getUpIndex();
|
||||||
|
|
||||||
$itemStack = $this->getItemStack();
|
if ($upIndex !== null) {
|
||||||
$itemStack[$this->getUpIndex()][SSViewer_Scope::ITEM_OVERLAY] = $this->overlay;
|
$itemStack = $this->getItemStack();
|
||||||
|
$itemStack[$upIndex][SSViewer_Scope::ITEM_OVERLAY] = $this->overlay;
|
||||||
|
|
||||||
$this->setItemStack($itemStack);
|
$this->setItemStack($itemStack);
|
||||||
$this->overlay = array();
|
$this->overlay = array();
|
||||||
|
}
|
||||||
|
|
||||||
return $scope;
|
return $scope;
|
||||||
}
|
}
|
||||||
@ -575,8 +578,12 @@ class SSViewer_DataPresenter extends SSViewer_Scope {
|
|||||||
* @return SSViewer_Scope
|
* @return SSViewer_Scope
|
||||||
*/
|
*/
|
||||||
public function popScope() {
|
public function popScope() {
|
||||||
$itemStack = $this->getItemStack();
|
$upIndex = $this->getUpIndex();
|
||||||
$this->overlay = $itemStack[$this->getUpIndex()][SSViewer_Scope::ITEM_OVERLAY];
|
|
||||||
|
if ($upIndex !== null) {
|
||||||
|
$itemStack = $this->getItemStack();
|
||||||
|
$this->overlay = $itemStack[$this->getUpIndex()][SSViewer_Scope::ITEM_OVERLAY];
|
||||||
|
}
|
||||||
|
|
||||||
return parent::popScope();
|
return parent::popScope();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user