From 6ec8d198319aa11c9d9eb006b78cdd084ce7aae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Zapletal?= Date: Tue, 25 Jun 2019 16:23:59 +0200 Subject: [PATCH] Fixed auto-removing parent structure on successNoFile form --- src/Component/Frontend/StructureModal/StructureModal.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Component/Frontend/StructureModal/StructureModal.php b/src/Component/Frontend/StructureModal/StructureModal.php index 262c11b..5e90776 100644 --- a/src/Component/Frontend/StructureModal/StructureModal.php +++ b/src/Component/Frontend/StructureModal/StructureModal.php @@ -357,6 +357,7 @@ public function successNoFile(Form $form) : void { $recipeSlug = $this->getRecipeSlug(); $structure = $this->getStructure(); + $parentStructure = $structure ? $structure->getParent() : NULL; $noFileVariables = $this->getNoFileVariables(); $this->structureManager->getConnection()->beginTransaction(); @@ -366,7 +367,8 @@ public function successNoFile(Form $form) : void $structure = $this->structureManager->save( $structure, $recipeSlug, - $this->user + $this->user, + $parentStructure ); $this->structureValueManager->saveNoFileFields(