driverok β credited Pavel_SPN β .
Pavel_SPN β created an issue.
Pavel_SPN β created an issue.
driverok β credited Pavel_SPN β .
Hi there!
As the drupal_get_schema() function (see bootstrap.inc) can returns FALSE I propose to add additional checks
to prevent FATAL errors on PHP8.1
for drupal_schema_field_types():
`$table_schema_fields = (!empty($table_schema['fields']) && is_array($table_schema['fields'])) ? $table_schema['fields'] : array();`
for drupal_schema_fields_sql():
`$schema_fields = (!empty($schema['fields']) && is_array($schema['fields'])) ? $schema['fields'] : array();`
All changes see in proposed merge request.
Best Regards,
Pavel
Pavel_SPN β made their first commit to this issueβs fork.
Hi there!
I have created MR to fix the issue, please check it.
Best Regards,
Pavel
Pavel_SPN β made their first commit to this issueβs fork.
Hi there! it works for me.
Hi there!
To be more compatible with previous versions of PHP (for example the type "mixed" available as of PHP 8.0.0) I propose to use
#[\ReturnTypeWillChange]
New patch attached.
Hi keshav.k
I applied the patch from comment #4 and its triggered an error when I tried to perform a search
Search is temporarily unavailable. If the problem persists, please contact the site administrator.
Rootcause.
Variable "$value" can be 0 then:
return trim($value) ; // returns string(1) "0"
return !empty($value) ? trim($value) : ''; // returns string(0) ""
As we can see there difference between returned values. This difference lead to wrong work of search.
To fix this issue I propose replace !empty() by isset():
return isset($value) ? trim($value) : '';
The patch from comment #2 is correct.
Ok, then let the maintainer decide which option is more suitable :)
Hi Ronino,
"The minimum recommended PHP version for Drupal 7 was PHP 7.2.x until its official end-of-life at 30 Nov, 2020."
https://www.drupal.org/docs/7/system-requirements/php-requirements-for-d... β (1)%20The%20minimum%20recommended%20PHP,get%20full%20PHP%208%20support.
Hi! I faced the same issues on the PHP8.1
I would suggest adding a return type to each method as the overridden methods only return the types of the parent methods.