]> _ Git - cubist_cms-back.git/commitdiff
#2843
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 3 Jul 2019 18:19:06 +0000 (20:19 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 3 Jul 2019 18:19:06 +0000 (20:19 +0200)
src/app/Magic/BunchOfFields.php
src/app/Magic/Models/CMSPage.php

index cf21e4dd351b26c6d7ccae48cf0b7a6b54eab37a..d7b053b7b3fb5b56acd44bd291cbf24eea62b4cd 100644 (file)
@@ -28,7 +28,13 @@ trait BunchOfFields
     {
         $attributes = array_merge($this->defaultFieldAttributes, $attributes);
         $field = Field::getInstance($attributes);
-        $this->_fields[$field->getAttribute('name')] = $field;
+
+        $key = $field->getAttribute('name');
+
+        if (isset($this->_fields[$key])) {
+            $key .= '1';
+        }
+        $this->_fields[$key] = $field;
 
         return $field;
     }
index 40d5693501c2df3f5d8c85c3cbad5aeeeec48f3d..64ede1a7bf85b869a65fd2163c3d05dd43a0fdb9 100644 (file)
@@ -139,7 +139,7 @@ class CMSPage extends CubistMagicNestedModel
     {
         // We need to know all the columns that will be needed by all the templates
         $this->useAllTemplates();
-        parent::setSchema($schema);
+        return parent::setSchema($schema);
     }
 
     public function useAllTemplates()