laravel-datatables
laravel-datatables copied to clipboard
Global Filter Not Working : Column Null in function globalSearch with postgreSQL
hello bro, I'm adjis from Indonesia. I use yajra datatables for a long time, but I have several projects using postgreSQL databases. I found a problem when searching data globally. after I search, I found the problem that the globalSearch function can't capture the table column. finally I tried to modify the line code to run properly.
the following code I have made:
if($query->first()){
$getColumns = array_keys($query->first()->getOriginal());
foreach($getColumns as $col){
if ($this->hasFilterColumn($col)) {
$this->applyFilterColumn($query, $col, $keyword, 'or');
} else {
$this->compileQuerySearch($query, $col, $keyword);
}
$this->isFilterApplied = true;
}
}
//OLD QUERY
if ($this->hasFilterColumn($column)) {
$this->applyFilterColumn($query, $column, $keyword, 'or');
} else {
$this->compileQuerySearch($query, $column, $keyword);
}
$this->isFilterApplied = true;
I made the code above to make the search run, but I don't know in the future there will be other problems after I make the code.
I hope there is an update that can solve the problem above.
thank you bro
- Files : QueryDataTable.php, Line : 740
- Version : ^9.19
- My Laravel : ^9.0
@adjisafandi can you send a pull request on the patch you did?
Also, can you provide a snippet on how to reproduce the issue? Thanks!
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.