From 888a3b781911ff8a1a6a907426ab5fe46039bd18 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 14 Jun 2019 18:22:47 +0200 Subject: [PATCH] fix #2836 @3 --- src/app/Magic/Controllers/CubistMagicControllerTrait.php | 1 + src/app/Magic/CubistMagicAttribute.php | 2 +- src/app/Magic/Fields/Field.php | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/Magic/Controllers/CubistMagicControllerTrait.php b/src/app/Magic/Controllers/CubistMagicControllerTrait.php index da2f4b0..98fd3ab 100644 --- a/src/app/Magic/Controllers/CubistMagicControllerTrait.php +++ b/src/app/Magic/Controllers/CubistMagicControllerTrait.php @@ -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'); diff --git a/src/app/Magic/CubistMagicAttribute.php b/src/app/Magic/CubistMagicAttribute.php index 8a107d7..004f8ec 100644 --- a/src/app/Magic/CubistMagicAttribute.php +++ b/src/app/Magic/CubistMagicAttribute.php @@ -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); diff --git a/src/app/Magic/Fields/Field.php b/src/app/Magic/Fields/Field.php index 787eeb8..7accbd2 100644 --- a/src/app/Magic/Fields/Field.php +++ b/src/app/Magic/Fields/Field.php @@ -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; -- 2.39.5