]> _ Git - cubist_cms-back.git/commitdiff
fix #2860 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jul 2019 10:38:55 +0000 (12:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Jul 2019 10:38:55 +0000 (12:38 +0200)
src/app/Magic/Fields/Model.php
src/app/Magic/Fields/SelectFromModel.php

index 7f4bf5218570d94223557fd4a61a0b26e77ffd2b..2560653f2c08927101bbd38a0db9863dc964a9eb 100644 (file)
@@ -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();
index 1042893761028a926f8f133bd4d1022f9e7c56b0..65f563082df6349494e14fea9695808640378c81 100644 (file)
@@ -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;
     }
 }