Loading src/Form/ColumnsForm.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\seeds_layouts\Form; use Drupal\Component\Uuid\Php; use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Form\ConfigFormBase; Loading Loading @@ -40,7 +40,7 @@ class ColumnsForm extends ConfigFormBase { /** * Uuid instance. * * @var \Drupal\Component\Uuid\Php * @var \Drupal\Component\Uuid\UuidInterface */ protected $uuid; Loading @@ -61,7 +61,7 @@ class ColumnsForm extends ConfigFormBase { EntityTypeManager $entity_type_manager, SeedsLayoutsManager $seeds_layouts_manager, FormBuilder $form_builder, Php $uuid UuidInterface $uuid ) { parent::__construct($config_factory); $this->entityTypeManager = $entity_type_manager; Loading src/Form/SeedsLayoutsConfigForm.php +8 −6 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ namespace Drupal\seeds_layouts\Form; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Uuid\Php; use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Form\ConfigFormBase; Loading Loading @@ -49,7 +49,7 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { /** * Uuid instance. * * @var \Drupal\Component\Uuid\Php * @var \Drupal\Component\Uuid\UuidInterface */ protected $uuid; Loading @@ -71,7 +71,7 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { LayoutFieldManager $layout_field_manager, SeedsLayoutsManager $seeds_layouts_manager, FormBuilder $form_builder, Php $uuid UuidInterface $uuid ) { parent::__construct($config_factory); $this->entityTypeManager = $entity_type_manager; Loading Loading @@ -196,7 +196,8 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { // Setup field config. if (!empty($form_state->getUserInput()['layout_fields'][$uuid])) { $layout_field = $form_state->getUserInput()['layout_fields'][$uuid]; } else { } else { $layout_field = @$config->get('layout_fields')[$uuid]; } Loading Loading @@ -241,7 +242,8 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { /** @var \Drupal\seeds_layouts\Plugin\LayoutF ieldInterface $layout_field_instance */ try { $layout_field_instance = $this->layoutFieldManager->createInstance($type, $layout_field_config); } catch (PluginNotFoundException $e) { } catch (PluginNotFoundException $e) { $this->messenger()->addError($e->getMessage()); continue; } Loading @@ -254,7 +256,7 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { $layout_field = $layout_field_instance->buildConfigurationForm($layout_field, $form_state); } $weight = isset($layout_field['weight']) ? $layout_field['weight'] : 0; $weight = $layout_field['weight'] ?? 0; // Add the field to the wrapper. $layout_fields_wrapper[$uuid] = [ '#weight' => $weight, Loading src/SeedsLayoutsManager.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\seeds_layouts; use Drupal\Component\Uuid\Php; use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\FileStorage; use Drupal\Core\Entity\EntityTypeManager; Loading Loading @@ -37,14 +37,14 @@ class SeedsLayoutsManager { /** * Uuid instance. * * @var \Drupal\Component\Uuid\Php * @var \Drupal\Component\Uuid\UuidInterface */ protected $uuid; /** * Constructs a new SeedsLayoutsManager object. */ public function __construct(EntityTypeManager $entity_type_manager, ConfigFactoryInterface $config_factory, Php $uuid) { public function __construct(EntityTypeManager $entity_type_manager, ConfigFactoryInterface $config_factory, UuidInterface $uuid) { $this->entityTypeManager = $entity_type_manager; $this->configFactory = $config_factory; $frameworks_config_path = drupal_get_path('module', 'seeds_layouts') . '/config/framework'; Loading Loading
src/Form/ColumnsForm.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\seeds_layouts\Form; use Drupal\Component\Uuid\Php; use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Form\ConfigFormBase; Loading Loading @@ -40,7 +40,7 @@ class ColumnsForm extends ConfigFormBase { /** * Uuid instance. * * @var \Drupal\Component\Uuid\Php * @var \Drupal\Component\Uuid\UuidInterface */ protected $uuid; Loading @@ -61,7 +61,7 @@ class ColumnsForm extends ConfigFormBase { EntityTypeManager $entity_type_manager, SeedsLayoutsManager $seeds_layouts_manager, FormBuilder $form_builder, Php $uuid UuidInterface $uuid ) { parent::__construct($config_factory); $this->entityTypeManager = $entity_type_manager; Loading
src/Form/SeedsLayoutsConfigForm.php +8 −6 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ namespace Drupal\seeds_layouts\Form; use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Uuid\Php; use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManager; use Drupal\Core\Form\ConfigFormBase; Loading Loading @@ -49,7 +49,7 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { /** * Uuid instance. * * @var \Drupal\Component\Uuid\Php * @var \Drupal\Component\Uuid\UuidInterface */ protected $uuid; Loading @@ -71,7 +71,7 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { LayoutFieldManager $layout_field_manager, SeedsLayoutsManager $seeds_layouts_manager, FormBuilder $form_builder, Php $uuid UuidInterface $uuid ) { parent::__construct($config_factory); $this->entityTypeManager = $entity_type_manager; Loading Loading @@ -196,7 +196,8 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { // Setup field config. if (!empty($form_state->getUserInput()['layout_fields'][$uuid])) { $layout_field = $form_state->getUserInput()['layout_fields'][$uuid]; } else { } else { $layout_field = @$config->get('layout_fields')[$uuid]; } Loading Loading @@ -241,7 +242,8 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { /** @var \Drupal\seeds_layouts\Plugin\LayoutF ieldInterface $layout_field_instance */ try { $layout_field_instance = $this->layoutFieldManager->createInstance($type, $layout_field_config); } catch (PluginNotFoundException $e) { } catch (PluginNotFoundException $e) { $this->messenger()->addError($e->getMessage()); continue; } Loading @@ -254,7 +256,7 @@ class SeedsLayoutsConfigForm extends ConfigFormBase { $layout_field = $layout_field_instance->buildConfigurationForm($layout_field, $form_state); } $weight = isset($layout_field['weight']) ? $layout_field['weight'] : 0; $weight = $layout_field['weight'] ?? 0; // Add the field to the wrapper. $layout_fields_wrapper[$uuid] = [ '#weight' => $weight, Loading
src/SeedsLayoutsManager.php +3 −3 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace Drupal\seeds_layouts; use Drupal\Component\Uuid\Php; use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\FileStorage; use Drupal\Core\Entity\EntityTypeManager; Loading Loading @@ -37,14 +37,14 @@ class SeedsLayoutsManager { /** * Uuid instance. * * @var \Drupal\Component\Uuid\Php * @var \Drupal\Component\Uuid\UuidInterface */ protected $uuid; /** * Constructs a new SeedsLayoutsManager object. */ public function __construct(EntityTypeManager $entity_type_manager, ConfigFactoryInterface $config_factory, Php $uuid) { public function __construct(EntityTypeManager $entity_type_manager, ConfigFactoryInterface $config_factory, UuidInterface $uuid) { $this->entityTypeManager = $entity_type_manager; $this->configFactory = $config_factory; $frameworks_config_path = drupal_get_path('module', 'seeds_layouts') . '/config/framework'; Loading