Skip to content
Snippets Groups Projects

Issue #3386505: Layout Builder: add check if there are no styles

Merged seda12 requested to merge issue/ui_styles-3386505:3386505-layout-builder-no into 8.x-1.x
12 files
+ 67
24
Compare changes
  • Side-by-side
  • Inline
Files
12
@@ -15,6 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* Block Layout Alter.
*/
class FormBlockFormAlter implements ContainerInjectionInterface {
use StringTranslationTrait;
/**
@@ -62,6 +63,15 @@ class FormBlockFormAlter implements ContainerInjectionInterface {
return;
}
$theme = $block->getTheme();
if ($theme == NULL) {
return;
}
if (empty($this->stylesManager->getDefinitionsForTheme($theme))) {
return;
}
$form['ui_styles'] = [
'#type' => 'container',
];
@@ -90,7 +100,7 @@ class FormBlockFormAlter implements ContainerInjectionInterface {
$extra = $settings['extra'];
}
// @phpstan-ignore-next-line
$form['ui_styles'][$part_id] = $this->stylesManager->alterForm($form['ui_styles'][$part_id], $selected, $extra);
$form['ui_styles'][$part_id] = $this->stylesManager->alterForm($form['ui_styles'][$part_id], $selected, $extra, $theme);
}
}
Loading