Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem + solution with GROUP_CONCAT + Search #108

Open
wrabit opened this issue Feb 12, 2016 · 3 comments
Open

Problem + solution with GROUP_CONCAT + Search #108

wrabit opened this issue Feb 12, 2016 · 3 comments

Comments

@wrabit
Copy link

wrabit commented Feb 12, 2016

Using Group_concat in the datatables query was breaking when using serverSide: true and searching.

This is a snippet to replace to get this working: (around Ln: 323 in Datatables.php)

  if($sSearch != '')
    for($i = 0; $i < count($mColArray); $i++)
      if($mColArray[$i]['searchable'] == 'true' )
        if($this->check_cType()) {
          if( strpos($this->select[$mColArray[$i]['data']], 'GROUP_CONCAT') !== false ) continue;
          $sWhere .= $this->select[$mColArray[$i]['data']] . " LIKE '%" . $sSearch . "%' OR ";
        } else {
          if( strpos($this->select[$mColArray[$i]['data']], 'GROUP_CONCAT') !== false ) continue;
          $sWhere .= $this->select[$this->columns[$i]] . " LIKE '%" . $sSearch . "%' OR ";
        }
@haider-pw
Copy link

for which version this change i can add to..

@buoncri
Copy link

buoncri commented May 11, 2017

I have tryed to replace the code, but it seems not working.
Can someone post the whole function (I think get_filtering) so i replace with no dubt of what to replace ? :-D

Thanks in advance

@wrabit
Copy link
Author

wrabit commented Oct 5, 2018

You could also just set "searchable: false" on the column from the front end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants