Project

General

Profile

Actions

Bug #96290

open

ActionController->forward does not work when targetting another extension

Added by Olivier Massot over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-12-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I have a created some extensions for our instance of Typo3.

There is among other things a core extension that implements:
- a base controller: SelectedSiteController
- a template: Resources/Private/SelectedSite/DisplayNoSelectedPageWarning.html

The purpose of SelectedSiteController is to be inherited by other extensions which have a BE module needing a website (a page) to be selected in the page tree.

I've got two other extension which have a controller inheriting this base class SelectedSiteController

This class SelectedSiteController acts as a middleware before any action and get the currently selected website (page), or, if no page is currently selected, should display a basic template showing a 'Please select a website' message.

The SelectedSiteController class looks like this:

class SelectedSiteController extends ActionController
{
    protected function callActionMethod() {
       // looking for the current website
       // ...

       if(!$selectedWebsite) {
           $this->forward('displayNoSelectedPageWarning', 'SelectedSite', 'MyCoreExt');
       }

       parent::callActionMethod();
    }

    protected function displayNoSelectedPageWarningAction() {}
}

Then, I have this class in another extension :

class MyController extends SelectedSiteController {
    // various actions
}

If I don't precise the extension in the 'forward' method, the child controller look for the template DisplayNoSelectedPageWarning.html in its own extension.

But if I define it explicitly, I've got this error:

(1/2) #1278450972 TYPO3\CMS\Extbase\Reflection\Exception\UnknownClassException

Class does not exist. Reflection failed.
in /var/www/typo3/public/typo3/sysext/extbase/Classes/Reflection/ReflectionService.php line 125

No data to display

Actions

Also available in: Atom PDF