From 9ad0b670e5dd348ab35a9b4b674cbde2f60902e7 Mon Sep 17 00:00:00 2001 From: ebremner <ebremner@uwaterloo.ca> Date: Mon, 18 Jan 2021 10:20:58 -0500 Subject: [PATCH] Issue #3193948: fixing issues where service not available on configure section form --- .../LayoutBuilderIdsConfigureSection.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/EventSubscriber/LayoutBuilderIdsConfigureSection.php b/src/EventSubscriber/LayoutBuilderIdsConfigureSection.php index 45de015..f6c1957 100644 --- a/src/EventSubscriber/LayoutBuilderIdsConfigureSection.php +++ b/src/EventSubscriber/LayoutBuilderIdsConfigureSection.php @@ -129,8 +129,11 @@ class LayoutBuilderIdsConfigureSection implements EventSubscriberInterface { // If there is a layout builder id, store it. if ($layout_builder_id !== NULL) { + // Get the form object from the form state. + $formObject = $form_state->getFormObject(); + // Get the layout. - $layout = ConfigureSectionForm::getLayout($form_state); + $layout = $formObject->getLayout(); // Load in the config for this section. $configuration = $layout->getConfiguration(); @@ -144,20 +147,6 @@ class LayoutBuilderIdsConfigureSection implements EventSubscriberInterface { } - /** - * Get the layout object. - * - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state object. - */ - private function getLayout(FormStateInterface $form_state) { - - // Get the form object. - $formObject = $form_state->getFormObject(); - - return $formObject->getLayout(); - } - /** * {@inheritdoc} */ -- GitLab