Skip to content
Snippets Groups Projects
Commit 727a9791 authored by Bram Goffings's avatar Bram Goffings Committed by Jimmy Henderickx
Browse files

Issue #3241658 by aspilicious: Ajax error when no custom blocks types are defined yet

parent 6b079b62
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ core: 8.x
core_version_requirement: ^8 || ^9
description: 'Layout builder browser improvements.'
type: module
package: 'Layout Builder'
dependencies:
- drupal:layout_builder
configure: layout_builder_browser.admin_blocklisting
......@@ -65,12 +65,17 @@ class BlockForm extends EntityForm {
$block_id = $browser_block->block_id;
$provider = isset($provider_options['Inline blocks']) ? 'Inline blocks' : '';
if($block_id) {
if ($block_id) {
$provider = $block_provider_map[$block_id];
}
if($form_state->getValue('provider')) {
if ($form_state->getValue('provider')) {
$provider = $form_state->getValue('provider');
}
// When no custom block types are defined the provider is empty, pick the first option as fallback.
if (empty($block_provider_map)) {
reset($block_provider_map);
$provider = key($block_provider_map);
}
$form['provider'] = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment