Project

General

Profile

Actions

Bug #91184

closed

Hook minifyJavaScript triggers deprecated warning

Added by Robert Vock over 4 years ago. Updated over 4 years ago.

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:

GeneralUtility.php#L1694

$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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #90377: Deprecate $ref param types of method callUserFunctionClosedAlexander Schnitzler2020-02-15

Actions
Actions #1

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64415

Actions #2

Updated by Georg Ringer over 4 years ago

  • Related to Task #90377: Deprecate $ref param types of method callUserFunction added
Actions #3

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64415

Actions #4

Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64415

Actions #5

Updated by Georg Ringer over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF