File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/app/Library/CrudPanel/Traits Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 44
55use Backpack \CRUD \ViewNamespaces ;
66use Carbon \Carbon ;
7- use Doctrine \DBAL \Types \JsonType ;
87use Validator ;
98
109trait Search
@@ -113,7 +112,7 @@ public function applyDatatableOrder()
113112 if (method_exists ($ this ->model , 'translationEnabled ' ) &&
114113 $ this ->model ->translationEnabled () &&
115114 $ this ->model ->isTranslatableAttribute ($ column ['name ' ]) &&
116- is_a ( $ this ->model -> getConnection ()-> getDoctrineColumn ( $ this -> model -> getTableWithPrefix (), $ column ['name ' ])-> getType (), JsonType::class )
115+ $ this ->isJsonColumnType ( $ column ['name ' ])
117116 ) {
118117 $ this ->orderByWithPrefix ($ column ['name ' ].'-> ' .app ()->getLocale (), $ column_direction );
119118 } else {
@@ -413,4 +412,9 @@ public function getColumnWithTableNamePrefixed($query, $column)
413412 {
414413 return $ query ->getModel ()->getTable ().'. ' .$ column ;
415414 }
415+
416+ private function isJsonColumnType (string $ columnName )
417+ {
418+ return $ this ->model ->getDbTableSchema ()->getColumnType ($ columnName ) === 'json ' ;
419+ }
416420}
You can’t perform that action at this time.
0 commit comments