Actions
Bug #91184
closedHook minifyJavaScript triggers deprecated warning
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2020-04-24
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
When using the Hook `minifyJavaScript`, you will get a Deprecated Warning in TYPO3 v10:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'][] = \Example\Extension\Hooks\JavascriptOptimization::class . '->jsMinify';
This happens because GeneralUtility::minifyJavaScript
calls the callUserFunction
method with as third parameter:
$fakeThis = false;
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['minifyJavaScript'] ?? [] as $hookMethod) {
try {
$parameters = ['script' => $script];
$script = static::callUserFunction($hookMethod, $parameters, $fakeThis);
which triggers the deprecation:
GeneralUtility.php#L3306
Actions