From b4244745f0e2c3a40026f148b0edda96d68d444b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 3 Jul 2019 20:19:06 +0200 Subject: [PATCH] #2843 --- src/app/Magic/BunchOfFields.php | 8 +++++++- src/app/Magic/Models/CMSPage.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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() -- 2.39.5