Bug #98950
closedCommandUtility::$paths must not be accessed before initialization
100%
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
Updated by Tomas Norre Mikkelsen about 2 years 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
Updated by Tomas Norre Mikkelsen about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Gerrit Code Review about 2 years 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
Updated by Tomas Norre Mikkelsen about 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f44ae8fa36499ef33704518026362503989a2b74.
Updated by Benni Mack almost 2 years ago
- Status changed from Resolved to Closed