Problem/Motivation
Status Report on D10.3. with php 8.3 says:
The following module is installed, but it is incompatible with PHP 8.3.6:
Diff
Steps to reproduce
precision = 24 (instead of default of 14) set in php.ini
Proposed resolution
change diff.info.yml from php8.1 to 8.3
name: Diff
type: module
description: Shows changes between content revisions.
php: 8.3
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2024-07-21_20h24_54.png | 27.66 KB | maxilein |
| #2 | 2024-07-20_17h13_30.png | 78.54 KB | maxilein |
Comments
Comment #2
maxilein commentedChanging to critical since my suggested fix did not work.
The message is still there. And blocks update.php
Comment #3
maxilein commentedInvestigating further this is the message in extend list:
This module requires PHP version 8.30000000000000071054274.* and is incompatible with PHP version 8.3.6.
I have a precision of 24 set in php.ini, because we need large numbers.
Comment #4
maxilein commentedchanging php: 8.3 to 8.3.6 makes the error go away.
Where is that check done?
I'd like to make sure that other modules can handle it correctly.
Comment #5
maxilein commentedComment #6
maxilein commentedThe same erroneous comparison is shown with 2.0beta.
Comment #7
maxilein commentedComment #8
acbramley commentedI cannot reproduce this on 8.3 with Diff 2.x.
Can you please try to reproduce this with a vanilla Drupal installation.
Comment #9
maxilein commentedHi,
this is the important difference: I have a precision = 24 (instead of default of 14) set in php.ini
You have to restart apache afterwards.
Where is the code that checks the php version in diff? I could not find it.
Comment #10
maxilein commentedComment #11
acbramley commentedAll version comparison code is in drupal core
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/syste...
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/syste...
Comment #12
quietone commentedComment #13
maxilein commentedComment #14
maxilein commentedAnother similar error.
https://stackoverflow.com/questions/10997482/php-version-compare-returns...
(https://www.php.net/manual/en/function.phpversion.php)
But I really don't understand where the extended float digits are coming from ...
Comment #15
maxilein commentedwrong issue...
Comment #16
dpiMarking a similar issue in Scheduled Transitions as duplicate.
User reports issues where the patch PHP version they have should match the minimum minor version required by the contrib.
--
My initial thought on this from the ST issue is it could be a YAML implementation issue; a difference between PHP YAML or YAML package.
Could also be some kind of strict typing thing where the `php` value of info.yml should be stringed after read.
But precision sounds like more of a clue.
Comment #17
mstrelan commentedThe Yaml decoder is interpreting the version as a float:
With precision 14:
With precision 17 (or above):
If the version in info.yml file is wrapped in quotes then it is interpreted as a string.
So we can either fix the yaml decoder, cast the version to a string in the
version_compare, or wrap the PHP version in quotes.Comment #18
mstrelan commentedI think we should probably validate the Yaml and cast to the correct type in
\Drupal\Core\Extension\ExtensionList::createExtensionInfo. Moving to extension component. Haven't looked for duplicates.