wintercms / wintercms/winter

Multiple default filters interfere with each other

Open
#1,151 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs test case
Dominant language
PHP
Stars
1.5k
Forks
246
Avg merge
19h 2m
Merged PRs (30d)
7

Description

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:

  1. CLEAR the first
  2. CLEAR the second
  3. Both are CLEARED visually, but in fact, the first has been reset to its default value! It is impossible to clear both filters!
approved_status:
        label: Approved status
        type: group
        conditions: approved_status in (:filtered)
        options:
           'x': X
           'y': Y
           'z': Z
        default:
            'x': X

    shipped_status:
        label: Shipped status
        type: group
        conditions: shipped_status in (:filtered)
        options:
            1: Shipped
            0: Not shipped
        default:
            0: Shipped
  1. image
  2. image
  3. image
Steps to replicate

See description

Workaround

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sequence in the issue with multiple default filters defined in config_filter.yaml: clear the first filter, then the second, and observe their values. Trace how default values and cleared state are handled for each filter; done means both filters remain cleared rather than the first reverting to its default.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.