Skip to content

Custom fields in media objects should run field hooks #544

@eduardoboucas

Description

@eduardoboucas

Currently, it's possible to filter media objects by any property, even by fields that don't exist in the media schema. However, when that is the case, the fields don't go through any field hooks, which has some unwanted side effects. For example, a $regex operator will not be transformed in a case-insensitive regular expression, as you would expect.

I'd really like us to formalise the structure of the media collection at some point, so that people would be able to define their own schemas rather than API allowing any field. Until we get there, perhaps the best option is to process custom fields and infer their type, running any applicable field hooks. This would cover String, Number and Boolean only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions