flux icon indicating copy to clipboard operation
flux copied to clipboard

php 7.1 syntax error in \flux\Classes\Utility\ExtensionConfigurationUtility.php

Open supercaccia opened this issue 2 years ago • 6 comments

Only with php 7.1, in \flux\Classes\Utility\ExtensionConfigurationUtility.php

the syntax:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['flux']['hooks'] ??= [];
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['flux']['hooks'] ??= [];

generate syntax error.

We can solve replacing with:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['flux']['hooks'] ?? [];
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['flux']['hooks'] ?? [];

(by removing the equal symbol at the end)

supercaccia avatar Apr 04 '22 15:04 supercaccia

ext_emconf.php says you need PHP 7.4+ composer.json says you need PHP 7.4+.

This bug is invalid.

cweiske avatar Apr 08 '22 14:04 cweiske

@NamelessCoder please close

cweiske avatar May 17 '22 13:05 cweiske

I was getting this error and I am using TYPO3 10.4.27 with PHP 7.4.28. I have manually edited the file on my site to remove the equals sign.

electricretina avatar May 17 '22 13:05 electricretina

The modification shown by @supercaccia does not solve the problem. The null coalescing assignment operator was introduced with php 7.4: https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.null-coalescing-assignment-operator

So using PHP 7.4 is enough, and the code does not need to be fixed.

cweiske avatar May 17 '22 15:05 cweiske

I've attached screen captures of the error and the PHP for the site where I receive the error..

Error Screen on the frontend...

Screenshot 2022-05-17 114951 .

PHP Environment in the TYPO3 backend... Screenshot 2022-05-17 115042

So, could it be that I'm running fpm version of PHP?

electricretina avatar May 17 '22 15:05 electricretina

This is my local dev server, the code runs fine on the production server. Strange. I agree that this is correct as written. I'm having a different issue. Thanks for all your work on this extension!

electricretina avatar May 17 '22 16:05 electricretina

Flux now avoids the null coalesce assign operator - both the original issue and the addition issue from @electricretina should both be solved now.

NamelessCoder avatar Nov 07 '22 14:11 NamelessCoder