Project

General

Profile

Actions

Bug #58746

closed

setTemplatePathAndFilename not work when original Template was not found

Added by Silvia Bigler almost 10 years ago. Updated almost 10 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-05-13
Due date:
% Done:

0%

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

Description

If I set a new Template in a controller action ( via $this->view->setTemplatePathAndFilename('path/to/template/List.html') ) I get this error when the original action file does not exist in the first place.

error:
Sorry, the requested view was not found.

The technical reason is: No template was found. View could not be resolved for action "search" in class "NWS\UserFjx217\Controller\FileController".

If the template search.html does not exist, I cannot use another template. This is somehow counterintuitive.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #34844: view->setTemplatePathAndFilename bugClosed2012-03-14

Actions
Actions #1

Updated by Markus Klein almost 10 years ago

  • Project changed from 534 to TYPO3 Core
Actions #2

Updated by Markus Klein almost 10 years ago

  • Category set to Extbase
  • Is Regression set to No
  • TYPO3 Version set to 6.2
Actions #3

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30980

Actions #4

Updated by Markus Klein almost 10 years ago

Can anyone provide an extension for testing the issue?
Thanks

Actions #5

Updated by Anja Leichsenring almost 10 years ago

In extbase context, setTemplatePathAndFilename is no public API. You are to configure this via TypoScript, but not in the controller.
The only use case, where you set the template on your own, is for Fluid Standalone View.

If you really really REALLY need to change the Template in the code (and most probably, you do not need to), do it in the initialize*Action, but I can not think of any case where this would be neccessary. So proof my wrong and I will rethink my vote, or provide your use case to let us help you to figure out what needs to be done. Setting the template explicit in the controller action is not the way in any case.

Actions #6

Updated by Christian Kuhn almost 10 years ago

  • Status changed from Under Review to Rejected

Please use initialize*Action() to set stuff like template pathes.

Actions #7

Updated by Sybille Peters almost 4 years ago

  • Related to Bug #34844: view->setTemplatePathAndFilename bug added
Actions

Also available in: Atom PDF