diff --git a/core/includes/theme.inc b/core/includes/theme.inc index f1bfe697c4..f8febe712b 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -818,8 +818,10 @@ function template_preprocess_image(&$variables) { foreach (['width', 'height', 'alt', 'title', 'sizes'] as $key) { if (isset($variables[$key])) { // If the property has already been defined in the attributes, do not - // override, including NULL. Attributes can be an array or an object. - if ((is_array($variables['attributes']) && array_key_exists($key, $variables['attributes'])) || (is_object($variables['attributes']) && property_exists($variables['attributes'], $key))) { + // override, including NULL. + // @todo the cast to array below is needed to get tests pass on PHP 7.4, + // but requires a separate issue to fix. + if (array_key_exists($key, (array) $variables['attributes'])) { continue; } $variables['attributes'][$key] = $variables[$key]; diff --git a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php index 85131ab8fa..5417dabc4a 100644 --- a/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php +++ b/core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php @@ -183,7 +183,7 @@ public function prepareRow(Row $row) { $field_data = unserialize($row->getSourceProperty('field_data')); // @todo the use of the coalesce operator below is needed to get // migrate tests pass on PHP 7.4. - $row->setSourceProperty('field_settings', $field_data['settings']); + $row->setSourceProperty('field_settings', $field_data['settings'] ?? NULL); return parent::prepareRow($row); } diff --git a/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php b/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php index d1807acad1..e8f15f6b9e 100644 --- a/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php +++ b/core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php @@ -72,7 +72,7 @@ public function prepareRow(Row $row) { $results = $query->execute()->fetchAssoc(); // @todo the use of the coalesce operator below is needed to get // migrate tests pass on PHP 7.4. - $row->setSourceProperty($other_property . '_translated', $results['translation']); + $row->setSourceProperty($other_property . '_translated', $results['translation'] ?? NULL); parent::prepareRow($row); }