From 2126c7d9bf5d2258e370aa82b77c100839bc5293 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 9 Jul 2019 12:38:55 +0200 Subject: [PATCH] fix #2860 @1 --- src/app/Magic/Fields/Model.php | 10 +--------- src/app/Magic/Fields/SelectFromModel.php | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) 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; } } -- 2.39.5