- Issue created by @commonpike
An error started appearing at odd moments, apparently after updating to php8
TypeError: Illegal offset type in isset or empty in FeedImport::getEntityInfo() (line 120 of /.../sites/all/modules/feed_import/feed_import_base/inc/feed_import.inc)
https://git.drupalcode.org/project/feed_import/-/blob/7.x-3.x/feed_impor...
The code there tries to do this
if (!isset($info->fields[$pval])) {
$info->properties[] = $pval;
}
while it seems clears to the code right above it that $pval is likely an array.
Update php8 and somehow invoke that method. I don't know why it got invoked at all.
if (is_scalar($pval) && !isset($info->fields[$pval])) {
To be honest, the code seems weird to me ?
Before php8, this would have thrown a warning,
but it has changed to an error
https://www.php.net/manual/en/migration80.incompatible.php
> A number of warnings have been converted into Error exceptions:
>
> * Attempting to use an invalid type (array or object) as an array key or string
> offset.
Active
3.4
Code
The issue particularly affects sites running on PHP version 8.0.0 or later.