Project

General

Profile

Actions

Bug #98950

closed

CommandUtility::$paths must not be accessed before initialization

Added by Stefan Froemken over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2022-10-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hello core team,

I just try to upgrade an extension for TYPO3 12. I'm using:

$command = CommandUtility::getCommand('sysctl');

which results in

Typed static property TYPO3\CMS\Core\Utility\CommandUtility::$paths must not be accessed before initialization

in /var/www/html/vendor/typo3/cms-core/Classes/Utility/CommandUtility.php line 311

Stefan

Actions #1

Updated by Tomas Norre Mikkelsen over 1 year ago

I have the same problem triggered by one of the tests in the TYPO3 Crawler when adding TYPO3 12 as dependency.

$phpPath = CommandUtility::getCommand($extensionSettings['phpBinary']);
Typed static property TYPO3\CMS\Core\Utility\CommandUtility::$paths must not be accessed before initialization

https://github.com/tomasnorre/crawler/blob/main/Classes/Utility/PhpBinaryUtility.php#L44

Actions #2

Updated by Tomas Norre Mikkelsen over 1 year ago

I'm not completely sure, but as there are no constructor (due to all functions are static) what about adding a default value for the `$paths`-array?

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Utility/CommandUtility.php#L78

    /**
     * Paths where to search for applications
     *
     * @var array
     */
    protected static $paths = [];

Edit: Isn't working

Actions #3

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

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

Actions #4

Updated by Gerrit Code Review over 1 year ago

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

Actions #5

Updated by Gerrit Code Review over 1 year ago

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

Actions #6

Updated by Gerrit Code Review over 1 year ago

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

Actions #7

Updated by Gerrit Code Review over 1 year ago

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

Actions #8

Updated by Gerrit Code Review over 1 year ago

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

Actions #9

Updated by Gerrit Code Review over 1 year ago

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

Actions #10

Updated by Gerrit Code Review over 1 year ago

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

Actions #11

Updated by Gerrit Code Review over 1 year ago

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

Actions #12

Updated by Gerrit Code Review over 1 year ago

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

Actions #13

Updated by Tomas Norre Mikkelsen over 1 year ago

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

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF