Project

General

Profile

Actions

Feature #84863

closed

Missing argument 1 for TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::__construct()

Added by Schu Miel over 6 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-04-25
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.0
Tags:
Complexity:
Sprint Focus:

Description

Hello,

the following line causes an error:

$temp_TSFEclassName = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\\Frontend\\Controller\\TypoScriptFrontendController');

PHP Warning: Missing argument 1 for TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::__construct(), called in /var/www/web5/htdocs/typo3_src-7.6.26/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 4546 and defined in /var/www/web5/htdocs/typo3_src-7.6.26/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php line 902

What can I do?

Actions #1

Updated by Schu Miel over 6 years ago

$GLOBALS['TSFE'] = new $temp_TSFEclassName($GLOBALS['TYPO3_CONF_VARS'], intval($pid), 0, true);

Actions #2

Updated by Schu Miel over 6 years ago

  • Tracker changed from Bug to Task
Actions #3

Updated by Schu Miel over 6 years ago

  • Tracker changed from Task to Feature
Actions #4

Updated by Stephan Großberndt over 6 years ago

  • Status changed from New to Rejected

Hi, this is the issue tracker for bugs in TYPO3 core. What you created as an issue is not a bug but a question on how to use the API in your extension.

In order to get support for questions like that please register in Slack https://forger.typo3.com/slack and ask your questions in channel #typo3-cms or use stackoverflow.

To answer your question: As the PHP warning tells you you called the constructor of `TypoScriptFrontendController` without specifying the necessary arguments (which is the TYPO3_CONF_VARS, ID of the page and page type)

Actions

Also available in: Atom PDF