Skip to content

Collection filters should check truthy-ness when no value set. #1000

@tech4him1

Description

@tech4him1

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
Currently, if a filter is set on a collection, without setting a value:

filter: {field: "contact"}

The CMS will only show files which do not contain this field.

- If the current behavior is a bug, please provide the steps to reproduce.

- What is the expected behavior?
In my opinion, this is counter-intuitive, and instead should check whether the field does exist. If no value is set, the CMS should show any file which contains the field, regardless of the value. For required fields, they always exist so this wouldn't matter, but for optional fields it does.

If people wanted to use the old behavior (checking for non-existent fields), I believe they would be able to set value: undefined.

- Please mention your CMS, node.js, and operating system version.

v1.0.3+master

- Please link or paste your config.yml below if applicable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions