Project

General

Profile

Actions

Bug #60338

closed

Changing view format does not affect partial format

Added by Mathias Brodala over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
-
Target version:
Start date:
2014-07-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Remote Sprint

Description

When using one view object to render a template in different formats (e.g. email in text and HTML), the template respects the requested format. However, partials are always rendered in the first rendered format. Example:

Content of templates/partials:

Content of Foo.txt:

Hello
<f:render partial="Bar"/>

Content of Partials/Bar.txt:

World

Content of Foo.html:

<p>Text</p>
<f:render partial="Bar"/>

Content of Partials/Bar.html:

<p>World</p>

1st invocation:

// Let $view be an instance of \TYPO3\CMS\Fluid\View\TemplateView
$view->setFormat('txt');
$view->render('Foo');

Result:

Hello
World

2nd invocation:

// $view is the same instance as above
$view->setFormat('html');
$view->render('Foo');

Result:

<p>Hello</p>
World

As you can see, the 2nd output was rendered using the txt-Partial.

This is due to the local partial identifier cache in AbstractTemplateView which only considers the partial name, not the current request format. If that one is incorporated, separate cache entries for each partial formats are created.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #66111: Add TemplateRootPaths support to cObject FLUIDTEMPLATEClosed2015-03-28

Actions
Actions

Also available in: Atom PDF