Problem/Motivation
When we try to add Tocify block in Layout Builder interface, after cllick by Add block button, nothing happens. And in DB log we can see next message:
Message TypeError: Argument 1 passed to Drupal\Core\Plugin\ContextAwarePluginBase::createContextFromConfiguration() must be of the type array, string given, called in /var/www/docroot/core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php on line 58 in Drupal\Core\Plugin\ContextAwarePluginBase->createContextFromConfiguration() (line 30 of /var/www/docroot/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php)
Steps to reproduce
- Log as admin
- Go to edit layout for node with enabled Layout Builder
- Click by add Table of contents block in LB UI
- Click Add block button
- Verify that block doen't add
- Go to DBlog (/admin/reports/dblog/)
- Verify that you can see the message that I've added above
Proposed resolution
Needs to provide a patch
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3225108.patch | 2.42 KB | aleevas |
Comments
Comment #2
aleevasSo the issue was in confused name of one option "context".
This name of config is reserved by LB. And ContextAwarePluginBase::createContextFromConfiguration() expect an array, but got a string from block settings.
I've added a patch in that I just rename this option to container in block settings. That solve issue.
Hope it will be helpfull for someone
Comment #4
sanduhrsThanks for the patch!