Warning: foreach() argument must be of type array|object, null given in paragraph_blocks_form_entity_view_display_edit_form_alter

Created on 27 February 2023, almost 2 years ago
Updated 22 May 2023, over 1 year ago

In certain configurations (I believe when a content type does not have any paragraph reference fields) there is nothing in

$form['layout']['layout_builder_restrictions']['allowed_blocks']['Paragraphs']['available_blocks']

, causing a PHP warning to be displayed in debug mode (in /admin/structure/types/manage/{bundle}/display) and in /admin/reports/dblog:

Warning: foreach() argument must be of type array|object, null given in paragraph_blocks_form_entity_view_display_edit_form_alter() (line 139 of modules/contrib/paragraph_blocks/paragraph_blocks.module).
🐛 Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

🇷🇴Romania melish

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

Comments & Activities

Production build 0.71.5 2024