Warning: Undefined array key "target_bundles"

Created on 29 May 2023, about 1 year ago
Updated 21 June 2023, 12 months ago

In the function `\Drupal\blazy\Field\BlazyEntityVanillaBase::getAvailableBundles`.

The line $targets = $handlers ? $handlers['target_bundles'] : []; give a error:

Warning: Undefined array key "target_bundles"

This is caused because sometimes (I couldn't say when), it does not have "target_bundles" key.

The solution for this is remplace for:

$targets = $handlers['target_bundles'] ?? [];

Error:

Warning: Undefined array key "target_bundles" in Drupal\blazy\Field\BlazyEntityVanillaBase->getAvailableBundles() (line 99 of /var/www/web/modules/contrib/blazy/src/Field/BlazyEntityVanillaBase.php).

🐛 Bug report
Status

Fixed

Version

2.15

Component

Code

Created by

🇨🇱Chile Aneida

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024