#96290ActionController->forward does not work when targetting another extension
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
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] ActionController->forward does not work when targetting another extension Resolves: #96290 Releases: main