From: Vincent Vanwaelscappel Date: Tue, 9 Jul 2019 10:38:55 +0000 (+0200) Subject: fix #2860 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2126c7d9bf5d2258e370aa82b77c100839bc5293;p=cubist_cms-back.git fix #2860 @1 --- diff --git a/src/app/Magic/Fields/Model.php b/src/app/Magic/Fields/Model.php index 7f4bf52..2560653 100644 --- a/src/app/Magic/Fields/Model.php +++ b/src/app/Magic/Fields/Model.php @@ -8,14 +8,6 @@ class Model extends Field { protected static $_options = []; - public function getColumnData() - { - $res = parent::getColumnData(); - $res['model'] = $this->getAttribute('optionsmodel'); - $res['attribute'] = $this->getAttribute('attribute'); - return $res; - } - public function getDefaultAttributes() { return array_merge(parent::getDefaultAttributes(), ['attribute' => 'name', 'allows_null' => false, 'allows_multiple' => $this->_multiple]); @@ -23,7 +15,7 @@ class Model extends Field protected function _getOptions() { - $cacheKey = $this->getAttribute('name') . '-' . $this->getAttribute('optionsmodel'); + $cacheKey = $this->getAttribute('optionsmodel'); if (!isset(static::$_options[$cacheKey])) { static::$_options[$cacheKey] = $this->__getOptions(); diff --git a/src/app/Magic/Fields/SelectFromModel.php b/src/app/Magic/Fields/SelectFromModel.php index 1042893..65f5630 100644 --- a/src/app/Magic/Fields/SelectFromModel.php +++ b/src/app/Magic/Fields/SelectFromModel.php @@ -52,7 +52,7 @@ class SelectFromModel extends Model public function getColumnData() { $res = parent::getColumnData(); - $res['options'] = $this->getAttribute('options'); + $res['options'] = $this->_getOptions(); return $res; } }