Problem/Motivation
When you try to add/edit a section, the ajax request fails.
Warning: foreach() argument must be of type array|object, string given in /var/www/html/web/core/lib/Drupal/Core/Render/Element/Checkboxes.php on line 113
Steps to reproduce
- Install the module and don't change default settings on the /admin/config/content/layout-builder-section-attributes form.
- Add or edit a section of a layout builder.
Issue fork layout_custom_section_classes-3308552
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:
- 3308552-fix-error
changes, plain diff MR !5
- 1.0.x
changes, plain diff MR !4
- 3308552-error-when-trying
changes, plain diff MR !3
Comments
Comment #7
kaszarobertGood catch! Thanks for your fix, I committed.
There's one last thing I'd like to ask: you mention in the issue that the AJAX request fails for you. I reproduced the PHP Warning but the AJAX calls were working for me. I tested it on latest Drupal 9, and on PHP 7.4 and PHP 8.1. The MR fixes the PHP Warnings fine.
@cbccharlie after this fix do you encounter these AJAX errors? If not, I'll put out a new release.
Comment #8
cbccharlie commentedWith this fix the errors disappear. Thanks @kaszarobert!
Comment #9
kaszarobertOkay, the fix is available in 1.0.4.