Problem/Motivation
When trying to use layoutcomponents in a custom block type and trying to add the custom block types field , afterwards we can't configure it because of the following error:
Error: Call to a member function get() on bool in Drupal\layoutcomponents\Form\LcUpdateBlockForm->blockContentToInline() (line 160 of /var/www/html/drupal/source/web/modules/contrib/layoutcomponents/src/Form/LcUpdateBlockForm.php)
The problem is that in src/Form/LcUpdateBlockForm.php->buildForm() there is the following condition
if (strpos($conf['id'], 'block_content:') > -1) {
}
Which works great for normal block content because they have the following format block_content:3d55f91a-872a-4819-b5bc-b29184cb98e5 but it also find the following format field_block:block_content:sidebar:id which is the custom block types field value and for this the blockContentToInline function fails.
Steps to reproduce
1.) create a custom block type with some fields
2.) in the layout try adding one of the blocks fields
3.) try to use the wrench icon to configure the block (error is thrown)
Proposed resolution
Change the condition to only search for id which starts with block_content because all the blocks will have the following block_content:UUID
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork layoutcomponents-3240816
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