Problem/Motivation

Currently there is the following PHP warning when you have an inline block entity with SDC display in layout builder UI:

Warning: Undefined array key "#contextual_links" in sdc_display_entity_view_alter() (line 340 of modules/contrib/sdc_display/sdc_display.module).

Steps to reproduce

  • Create a custom block type with some field(s) and enable SDC display on it default view mode
  • Use the layout builder (e.g. on a node) and add a block of the custom type created before
  • There will be the above mentioned warning

Proposed resolution

  • Check $build['#contextual_links'] for existence before using it and fall back to an empty array otherwise

Remaining tasks

  • Create patch/MR to fix the issue

User interface changes

n/a

API changes

Data model changes

n/a

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hctom created an issue. See original summary.

shreya_th’s picture

Assigned: Unassigned » shreya_th
hctom’s picture

Status: Active » Needs review

Please see the issue fork for the necessary change.

@Shreya_th: Sorry, I forgot to assign the issue to me. The necessary changes should be done already, but feel free to test them, Thanks

shreya_th’s picture

Assigned: shreya_th » Unassigned

shalini_jha’s picture

Hi @hctom
MR 16 changes working for me.

e0ipso made their first commit to this issue’s fork.

  • e0ipso committed 73afb4a9 on 1.x authored by hctom
    Issue #3395226 by hctom, shalini_jha: Undefined array key "#...
e0ipso’s picture

Status: Needs review » Fixed

This looks good!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.