Selecting null values in searchpane gives no results when using serverside data
Selecting null values in searchpane gives no results when using serverside data
![jamesj2](https://secure.gravatar.com/avatar/4319c0ce4957acdeda5a99e53a048844/?default=https%3A%2F%2Fvanillicon.com%2F4319c0ce4957acdeda5a99e53a048844_200.png&rating=g&size=120)
in Bug reports
Replies
Hi @jamesj2 ,
I've tried to get this running this morning but the script is throwing some errors - I think to do with some needed updates on my side. I'll take a closer look tomorrow and hopefully get it running then.
Thanks,
Sandy
Hi @jamesj2 ,
That took a lot longer than I was expecting it to, sorry for the delay!
I've made a fix for this in both the SearchPanes repo as well as the editor library repos. To get this you will need to pull in the code from the nightly version of SearchPanes. You will also need to pull in the latest from this repo, alternatively this will all be released within the next week or two if you can wait.
Let me know if you run into any more difficulty.
Thanks,
Sandy
I'm going to wait for the official release. Thanks for your help!
I think this is still an issue.
I have a lot of fields in my database set to PostgreSQL's
null
value. I use SearchPanes PHP'srender
function to relabel these to "[not set]".However, selecting these null value options in SearchPanes throws a JS error and causes the loading indicator remain showing.
The error thrown in the console is,
TypeError: null is not an object (evaluating 'item.filter.toString')
indatatables.js
line 23,949.Versions:
- DataTables 1.13.6
- SearchPanes: 2.2.0
- Editor: 2.2.2
Could you try the SearchPanes nightly please? I've added a fix for this specific issue.
Allan
@allan I installed the nightly version and the error is no longer thrown (and no errors are thrown), so that seems good.
My new issue is that the SeachPanes + Server Side Processing doesn't properly filter for null values in the database. Instead it searches for an empty string; see the Editor Debug info below:
Sorry - there was a bug in how we were checking for results, which didn't take
null
values into account. I've committed the fix for PHP (our .NET and Node.js libraries had the same issue and have also had commits to fix the issue).To apply, you could modify your existing
Editor.php
file with that, or just grab the full file and replace the whole thing for what you are using locally.There was also a possible out of bounds index error, due to potentially missing information sent from the client-side which has also been fixed. To see that error would have required multiple items selected, including a null value. That will be in the SearchPanes nightly shortly.
Phew - and with all of that, it should hopefully work well for you now!
Regards,
Allan
@allan That change to the
Editor.php
file has solved this problem. Thank you.Awesome - thanks for letting me know.
I'll get a release of SearchPanes and Editor out sometime in the near future to have them properly up to date.
Allan