Problem/Motivation

When using layout builder and trying to add a component to a page, the component is not added. There is no modal activated. This error is seen in the console:

Warning: Undefined array key "provider" in /var/www/html/docroot/modules/contrib/inline_block_title_automatic/src/FormAlter.php on line 52

Steps to reproduce

Use layout builder with the inline block title module activated.

Proposed resolution

Check if the array 'provider' is set before comparison.

CommentFileSizeAuthor
#4 3437381_warning_fix.patch844 byteserik_petra
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

JeffMattson created an issue. See original summary.

jeffreysmattson’s picture

Title: AJAX error Undefined array key "provider" » AJAX error Undefined array key 'provider'
erik_petra’s picture

StatusFileSize
new844 bytes

I have a similar issue, where "settings" is undefined, since we have a form to choose between reusable and a new inline block, and the form alter triggers for it. (Warning: Undefined array key "settings")

Having that isset check is overall helpful and makes the module more resilient. I copied the PR diff (#2) to the patch.

erik_petra’s picture

Status: Active » Needs review