Open AIC-BV opened 3 months ago
Also, when you have default filters (doesn't matter wether its single or multiple),
clear them, and go to the next page, the filters get reapplied and you can never go to the second page
I believe the same happens when you clear and search for something.
@AIC-BV could you test if this commit has anything to do with this?
https://github.com/wintercms/winter/commit/4847f8bc92b17c689f3ff163f4672ba7155362e4
@AIC-BV could you test if this commit has anything to do with this?
I changed my files and ran php artisan winter:util compile js
but I don't notice any changes. Still not working. Must be broken for years now and an unused functionality 😅
The problem would be that when a filter is empty, it would instead apply the default value. There's no way for a filter to send a POST value to indicate it is empty and not populate the default value.
I had the same issue with an ecommerce site (being able to filter between order status as well as completed or incomplete orders), and I had to change the "completed" filter to a checkbox that, when ticked, only included "completed" orders. You could possibly do the same with your "shipped" filter.
EDIT: These were the scopes I used
scopes:
paid:
label: Completed orders only
type: checkbox
default: 1
conditions: placed_at IS NOT NULL
status:
label: Status
type: group
scope: isStatus
modelClass: \BennoThommo\Snowcart\Models\Status
options: getList
placed_at:
label: Placed at
type: daterange
yearRange: 10
conditions: DATE(placed_at) >= ':afterDate' AND DATE(placed_at) <= ':beforeDate'
scopes: paid: label: Completed orders only type: checkbox default: 1 conditions: placed_at IS NOT NULL
I'm not entirely following:
paid -> default: 1
.paid value 0
on the 2nd page or by search.Or does the checkbox avoid this problem..?
Sorry for the delay @AIC-BV. As I recall, my setup above didn't exhibit any problems when switching pages. If you're willing, would you mind providing us an example in the Test plugin?
Winter CMS Build
dev-develop
PHP Version
8.1
Database engine
MySQL/MariaDB
Plugins installed
No response
Issue description
When you have multiple defined default filters in
config_filter.yaml
and do the following action:CLEAR the first
CLEAR the second
Both are CLEARED visually, but in fact, the first has been reset to its default value! It is impossible to clear both filters!
Steps to replicate
See description
Workaround
No response