- 🇮🇳India sahilgidwani Jaipur
I am reopening this issue, as I am getting warnings and errors, as mentioned in the descriptions in version 9.5.9 and PHP 8.
- 🇨🇦Canada No Sssweat
After upgrading from PHP 7.4 to 8.1
I am also seeing the type error and the array flip warning that comment #5 mentions with Drupal 9.5.11
TypeError: Illegal offset type in Drupal\Core\Entity\ContentEntityStorageBase->loadRevision() (line 636 of /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php)
Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\ContentEntityStorageBase->loadMultipleRevisions() (line 667 of /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php)
Going through the code in xdebug for some reason with PHP 8.1 it triggers different kernel events compared to 7.4 with the same codebase and DB.
7.4 does a kernerl.response while 8.1 does a kernel.controller event.
Also 7.4 has more service definitions while 8.1 has less (802 vs 754)
- 🇨🇦Canada No Sssweat
As mentioned in comment #6, because of the different kernel events. Different values end up being passed to the error and the warning lines.
One of these values is an empty revisions array and a node object as a revision id instead of a string or int.
This might not be the optimal solution, but I manage to get passed those by checking if it's not empty.
- last update
8 months ago 30,341 pass