I have developed a custom TYPO3 extbase extension that was perfectly worked on 8 and 9 version of TYPO3.
Recently I upgraded my installation to TYPO3 10 version but the php based views of my TYPO3 extbase extension do not work anymore.
The error that is displayed is:
Sorry, the requested view was not found.
The technical reason is: No template was found. View could not be resolved for action "getIcal" in class "LucLucevents2ControllerEventController"
I have read the instructions in the page
https://docs.typo3.org/m/typo3/book-extbasefluid/10.4/en-us/8-Fluid/9-using-php-based-views.html, but there is nothing different from what I have already done in my extension.
So, I am very confused because there is no explanation why the code stopped to work, the above link doesn’t include any instructions about deprecated code or possible changes after migration!!
Could you give me any help?
Thank you very much!
George
2
Answers
the static template is already included and all the other operations of the extension are working very well except the php based views. The ext_localconf.php looks as follows: <?php defined('TYPO3_MODE') || die('Access denied.');
$boot = function () {
};
$boot();
unset($boot);
The action is registered in EventController.php and looks as follows:
/** * action geticalaction * * @param LucLucevents2DomainModelEvent $event * @return void */
Thank you very much!
I hit this problem today. The documentation for "php based views" seems to be outdated.Below is a description of my setup and the solution for TYPO3 10
What I had:
My situation was that I had a Controller with a showAction() action method.
In typoscript, I had setup a new format through the type parameter. Something like
For this type (parameter type=58978) I had setup a class named ViewEventFeedsShowRss with a render() method.
TYPO3 automatically resolved this class based on the type (rss) and the action name (show). This does not work any more.
What solves this issue:
in order for TYPO3 to find the correct class with the render method, it is sufficient to set the defaultViewObjectName variable of the Controller to the correct class name for the specific action. This can be done in the controller with the following new method
So now, before calling the showAction method, defaultViewObjectName is set to my ShowRss class which produces the output.
Please note that my ShowRss class extends
TYPO3CMSExtbaseMvcViewAbstractView
. According to https://docs.typo3.org/m/typo3/book-extbasefluid/master/en-us/8-Fluid/9-using-php-based-views.html this is deprecated in TYPO3 11 and will have to change for TYPO3 12