From: Vincent Vanwaelscappel Date: Wed, 3 Jul 2019 18:19:06 +0000 (+0200) Subject: #2843 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b4244745f0e2c3a40026f148b0edda96d68d444b;p=cubist_cms-back.git #2843 --- diff --git a/src/app/Magic/BunchOfFields.php b/src/app/Magic/BunchOfFields.php index cf21e4d..d7b053b 100644 --- a/src/app/Magic/BunchOfFields.php +++ b/src/app/Magic/BunchOfFields.php @@ -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; } diff --git a/src/app/Magic/Models/CMSPage.php b/src/app/Magic/Models/CMSPage.php index 40d5693..64ede1a 100644 --- a/src/app/Magic/Models/CMSPage.php +++ b/src/app/Magic/Models/CMSPage.php @@ -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()