- Issue created by @chandu7929
- last update
about 1 year ago 32 pass - Status changed to RTBC
about 1 year ago 11:39am 3 November 2023 - Status changed to Active
about 1 year ago 11:41am 3 November 2023 - ๐ฉ๐ชGermany gbyte Berlin
How is the nullsafe operator a syntax error? Are you using PHP < 8.0 by any chance? Also, blind setting to 'Reviewed & tested by community' by your colleague is not what I expect from Acquia.
- ๐ฎ๐ณIndia rajeshreeputra Pune
@gbyte in comment mentioned that this is tested with php 7.4. We can update the description as this error only happens with PHP less than 8.0 version.
- ๐ฎ๐ณIndia chandu7929 Pune
@gbyte, we have in-house CI which runs on multiple versions of PHP and its failing for one our our job which is configured to run with PHP 7.4, I think we should add minimum php support version in the release.
- ๐ฉ๐ชGermany gbyte Berlin
@gbyte in comment mentioned that this is tested with php 7.4. We can update the description as this error only happens with PHP less than 8.0 version.
Are you kidding me? You guys create a *critical* bug report about a "syntax error" oblivious to it being a language feature in the supported version of PHP. Then you RTBC it without even looking at it. Editing your comment and claiming you knew all along makes things worse.
Feel free to add a PR for min PHP version.
- last update
about 1 year ago 32 pass - Status changed to Needs review
about 1 year ago 12:33pm 3 November 2023 - ๐ฎ๐ณIndia rajeshreeputra Pune
Updated the MR to include the PHP minimum requirement "^8".
- ๐ท๐บRussia walkingdexter
@gbyte Our
core_version_requirement
key says that the module requires Drupal 9.3.0 or later. The minimum PHP version for 9.3.0 is 7.3. Yeah, it's not recommended โ anymore, but there may still be Drupal 9 sites that use PHP 7.3 or PHP 7.4.I see the following solutions:
- Increase
core_version_requirement
to^10
. - Don't use PHP 8 features (like the Nullsafe operator) while the module supports Drupal 9.
- Set PHP version requirement for the module.
- Increase
- last update
about 1 year ago 32 pass - @rajeshreeputra opened merge request.
- Open on Drupal.org โCore: 9.5.x + Environment: PHP 8.1 & MySQL 8last update
about 1 year ago Not currently mergeable. - last update
about 1 year ago 32 pass - ๐ฎ๐ณIndia rajeshreeputra Pune
@WalkingDexter I like the approach and created MR with PHP_VERSION compare.
- last update
about 1 year ago 32 pass - last update
about 1 year ago PHPLint Failed - last update
about 1 year ago 32 pass - last update
about 1 year ago 32 pass - Status changed to Needs work
about 1 year ago 9:05am 7 November 2023 - ๐ท๐บRussia walkingdexter
@Rajeshreeputra This won't work. Your changes suggest that the
$variant
variable will have different values depending on the PHP version. Also checking the PHP version at runtime is an overhead in our case. - ๐ซ๐ทFrance hassebasse
I wanted to inform you that I have also encountered this issue while using PHP 7.4. Unfortunately, I cannot upgrade to version 8.0 or higher because I have some other modules that are not compatible with it.
Drupal 9.5.11
- ๐ฉ๐ชGermany gbyte Berlin
This seems to be a bigger problem than I expected - many people are use an unsupported PHP version.
Don't use PHP 8 features (like the Nullsafe operator) while the module supports Drupal 9.
I'm OK with dropping the operator until we drop support for D9 (which is oficially unsupported now too, BTW).
@WalkingDexter Let's get this in as well as ๐ When multiple sitemaps of type "Default hreflang" are defined, only one can be overwritten Needs work and so we can create a hotfix release.
- ๐ฎ๐ณIndia sijumpk
@gbyte Its better to start a separate 5.x version for such major changes.
- ๐ฉ๐ชGermany gbyte Berlin
@sijimpk That's very observant, maybe I should put you on the module board so you can overrule major decisions like the introduction of the PHP nullsafe operator.
- ๐ฎ๐ณIndia vishalkhode
@gbyte / @WalkingDexter To ensure compatibility with both PHP 7.4, 8.0 (and above), I think we can use the following approach:
1. New Minor Release for PHP 8.0 and above (i.e 4.2.x):
- Create a new minor release (i.e 4.2.0) supporting PHP 8.0 (and above) and update composer.json to set minimum PHP version requirement as follows:
"require": { "php": "^8.0", }
2. Patch Release for PHP 7.4 Compatibility (i.e 4.1.x):
- Create a new patch release (i.e 4.1.8) and ensure it works as expected on PHP 7.4 and update composer.json to set minimum PHP version requirement as follows:
"require": { "php": "^7.4", }
Following above releases, composer will automatically download version 4.1.x or 4.2.x based on the user's PHP version, maintaining compatibility across different PHP versions and then later we can drop support for 4.1.x whenever we wish to end support for PHP 7.4.
- Create a new minor release (i.e 4.2.0) supporting PHP 8.0 (and above) and update composer.json to set minimum PHP version requirement as follows:
- ๐ฎ๐ณIndia rajeshreeputra Pune
@vishalkhode I appreciate the plan; version 4.1.8 will maintain support for PHP 7.4 and 8.0, while the upcoming 4.2.0 release from the 4.x branch will exclusively support PHP 8.0 and above. This allows flexibility for those who may choose to stick with 4.1.8 temporarily due to various reasons before upgrading to 4.2.0.
Regarding the composer.json update, the PHP version for 4.1.8 release can be set like this:"require": { "php": "^7.4 || ^8.0", }
- last update
about 1 year ago 32 pass - ๐ณ๐ฑNetherlands renรฉ bakx Netherlands
The patch in #16 is incomplete, there is another PHP8 construct in Generator.php (src/Manager/Generator.php) as well.
public function getDefaultVariant(): ?string { return $this->getDefaultSitemap()?->id(); }
- Status changed to Fixed
about 1 year ago 8:50pm 23 November 2023 - ๐ฉ๐ชGermany gbyte Berlin
I removed usages of the nullsafe operator and may introduce them in the next minor release. Let me know if anything breaks as I intend to push a patch release very soon.
Automatically closed - issue fixed for 2 weeks with no activity.