Problem/Motivation
Seeing the following warning in watchdog log:
Warning: Undefined array key "context_visibility" in layout_builder_context_form_alter() (line 33 of /app/web/modules/contrib/layout_builder_context/layout_builder_context.module)
Steps to reproduce
Configuring a layout builder section that has not previously used Layout Builder Context and check PHP notices in the log.
Proposed resolution
Relevant line 33:
$contexts = is_array($configuration["context_visibility"]) ? $configuration["context_visibility"] : [];
Just use the null coalescing operator, It's cleaner and does the trick.
Comments
Comment #2
amanire commentedComment #3
amanire commentedComment #4
amanire commentedComment #5
amanire commentedComment #6
amanire commentedComment #7
amanire commentedComment #10
darkodev commentedThanks for fixing. Works for us.
Comment #11
darkodev commentedComment #13
kevinquillen commented