]> _ Git - cubist_cms-back.git/commitdiff
fix #2836 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 14 Jun 2019 16:22:47 +0000 (18:22 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 14 Jun 2019 16:22:47 +0000 (18:22 +0200)
src/app/Magic/Controllers/CubistMagicControllerTrait.php
src/app/Magic/CubistMagicAttribute.php
src/app/Magic/Fields/Field.php

index da2f4b04bffaf321429e0b5e08b0ad34a73ead86..98fd3aba8f3985ad271a10e8dcf76ffc1cbb5106 100644 (file)
@@ -23,6 +23,7 @@ trait CubistMagicControllerTrait
             $this->crud->allowAccess('clone');
         }
         $this->crud->allowAccess('revisions');
+        $this->crud->enablePersistentTable();
 
         $this->crud->setCreateView('cubist_back::create');
         $this->crud->setEditView('cubist_back::edit');
index 8a107d78a11d912487ceebe79b1a5a5370926fd8..004f8ece2a1e3dab74cbbcd8c6986685675b7dfe 100644 (file)
@@ -29,7 +29,7 @@ trait CubistMagicAttribute
     public function setAttributeIfNotSet($key, $value)
     {
         $k = $this->_attribute($key);
-        if ($this->hasAttribute($k)) {
+        if ($this->getAttribute($key, null) !== null) {
             return;
         }
         $this->setAttribute($k, $value);
index 787eeb8f449cbb402d1ffd533b9a25aa037f6a18..7accbd28edfb7ff0fbc066afa645e67e30d1bcaf 100644 (file)
@@ -19,6 +19,7 @@ class Field
     protected $_adminType = 'text';
     protected $_viewNamespace = 'crud::fields';
     protected $_columnViewNamespace = 'crud::columns';
+    protected $_searchLogic = 'text';
 
     protected $_databaseType = 'text';
     protected $_databaseUnique = false;
@@ -96,7 +97,7 @@ class Field
     {
         return ['type' => $this->_adminType, 'view_namespace' => $this->_viewNamespace, 'column' => false, 'form' => 'both', 'rules' => '',
             'fillable' => true, 'guarded' => false, 'hidden' => false, 'translatable' => $this->_translatable,
-            'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast, 'column_view_namespace' => $this->_columnViewNamespace,
+            'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast, 'column_view_namespace' => $this->_columnViewNamespace, 'searchLogic' => $this->_searchLogic,
             'allow_null' => true,
             'fake' => false, 'store_in' => false, 'attributes' => [],];
     }
@@ -142,7 +143,8 @@ class Field
             'name' => $this->getAttribute('name'),
             'view_namespace' => $this->getAttribute('column_view_namespace'),
             'type' => $this->getAttribute('column_type'),
-            'label' => $this->getAttribute('column_label', $this->getAttribute('label'))
+            'label' => $this->getAttribute('column_label', $this->getAttribute('label')),
+            'searchLogic' => $this->getAttribute('searchLogic'),
         ];
 
         return $res;