undefined array keys with inline blocks

Created on 19 December 2023, over 1 year ago

This module generates PHP warnings when adding or configuring inline blocks using Layout Builder.

Warning: Undefined array key 2 in extra_field_plus_form_alter() (line 295 of /app/web/modules/contrib/extra_field_plus/extra_field_plus.module)

Warning: Undefined array key 3 in extra_field_plus_form_alter() (line 296 of /code/web/modules/contrib/extra_field_plus/extra_field_plus.module)

The culprit is this snippet here, beginning on line 293 of extra_field_plus.module:

    [
      $componentPluginId,
      $entity_type_id,
      $bundle,
      $field_name,
    ] = explode(ExtraFieldBlock::DERIVATIVE_SEPARATOR, $component->get('configuration')['id'], 4);

Inline block configuration IDs only have two elements (example: inline_block:document_table). So, $bundle and $field_name are never set -- generating the warnings.

๐Ÿ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jesss

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024