Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / layout_builder / src / Form / AddBlockForm.php
index 704d136ba96fc03d0b22520c16e40c6cb707a232..1d873308a1f2f5571db6ab2c65f6d688fd3f879a 100644 (file)
@@ -48,10 +48,10 @@ class AddBlockForm extends ConfigureBlockFormBase {
    */
   public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $plugin_id = NULL) {
     // Only generate a new component once per form submission.
-    if (!$component = $form_state->getTemporaryValue('layout_builder__component')) {
+    if (!$component = $form_state->get('layout_builder__component')) {
       $component = new SectionComponent($this->uuidGenerator->generate(), $region, ['id' => $plugin_id]);
       $section_storage->getSection($delta)->appendComponent($component);
-      $form_state->setTemporaryValue('layout_builder__component', $component);
+      $form_state->set('layout_builder__component', $component);
     }
     return $this->doBuildForm($form, $form_state, $section_storage, $delta, $component);
   }