I have an issue with filter a list in backend, I define a filter for Workshops model as below: The filter is working perfectly if number of records <= 500. Its not seem to be execute if the records > 500. Anyone was facing that, please help me, many thanks.
I have followed the document https://octobercms.com/docs/backend/lists#list-filters
scopes: workshop_code: label: 'workshop_code' modelClass: Plugin\Plugin\Models\Workshops nameFrom: workshop_code conditions: id in (:filtered)
This is probably best logged via the GitHub repo, since it may relate to a code issue.
It seems that I got the same issue here: http://octobercms.com/forum/post/backend-list-filters-issue
In my post I describe a detailed case where the filters are not applied at all when the number of records of the Model used to filter is more than 500.
Hi all, Did you find any solution for this..
We still haven't seen a GitHub issue logged for this, so it hasn't been looked at.
Found the solution.
Set a maximum value for "max_input_vars" attribute in php.ini file
I tried to set a maximum value for "max_input_vars" but it doesn't work. I found a temporary solution for this issue, so, we have to modify the line $query->limit(500) in Filter.php file and voila. The problem is going to be when we update the October version that these changes are lost so we should keep that in mind ;-)
After 2 years this fix is still here and induced another issue. If the user is going to select the item that is >500, the picked item will not be selected. After a few trials, everything works fine by removing the $query->limit(500).
I suspect the user failed to select other items is that when the filter first init, it only collected the first 500 items ID number, so when the user searched and picked items beside the first 500 items, it cannot collect the correct ID and hence failed to perform properly.
I suggest removing line 391 - 395 of /modules/backend/widgets/Filter.php in next update.
This line will be removed in the next version of October CMS. Thanks
1-9 of 9