Problem/Motivation
Fix PHP 8 and 8.1 compatibility issues/deprecations
Proposed resolution
TBD
Issue fork feeds-3261188
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joelpittetDiscussed during call in ContributionWeekend2022, we are considering requiring dev release for tests of pathauto to resolve an issue that has been committed but not released for PHP 8.
Comment #3
megachrizHello
Comment #4
modestmoes commentedCollaborating with @joelpittet on this for ContributionWeekend2022
Comment #5
megachrizComment #6
beanjammin commentedWatched over @joelpittet's shoulder while barking out the occasional "helpful" comment.
Comment #9
joelpittetComment #12
megachrizI closed merge request !46 because there has been a new release of Pathauto which makes it no longer necessary to require the dev version of Pathauto for testing.
Opened a new issue fork to actively work on tests that fail on PHP 8.1. Some PHP 8.1 issues have been fixed in the mean time in other issues:
#3266706: Deprecated getIterator() and count() using PHP 8.1
#3267244: Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\feeds\Plugin\Field\FieldType\FeedsItem->preSave()
#3266704: PHP 8.1: do not pass null to Html::escape() and Unicode::truncate().
Comment #13
megachrizUpdateCustomSourcesUpdateTest test failure
The following failure looks like a bug in Drupal Core:
mb_strtolower()is called inIn
\Drupal\Core\Config\Entity\Query\Condition::compile():I've inspected what the condition is and it happens to be:
Array ( [field] => uuid [value] => NULL [operator] => = [langcode] => NULL)In
\Drupal\Core\Config\Entity\ConfigEntityBase::preSave()the entity's UUID is passed as condition:But it is valid that
::uuid()can returnNULL, see\Drupal\Core\Entity\EntityBase::uuid():I've found some existing core issues related to this:
https://www.drupal.org/project/issues/drupal?text=mb_strtolower+null+uui...
I think it would be good to open a core issue for above.
auto_detect_line_endings
Using
ini_set('auto_detect_line_endings', '1');is deprecated in PHP 8.1. According to https://php.watch/versions/8.1/auto_detect_line_endings-ini-deprecated, this means that line-endings for\rcharacters are no longer supported.But removing the usage of that in
\Drupal\feeds\Component\CsvParserdoes now cause a test failure.So the question is: should Feeds actively remove support for CSV files with
\rline endings or is there a workaround?Comment #14
megachrizHopefully fixed all test failures now:
%guidwasNULLand passing that as an argumentt()causes an error when the translation gets rendered:\rline endings - the test coverage for this gets removed.Comment #16
megachrizI merged the changes. I looked once more on why for certain methods of
\Drupal\feeds\Component\CsvParserI added#[\ReturnTypeWillChange]and that is because the return type "mixed" is only available since PHP 8.1. Hm, should add an additional commit that notes that.