Skip to content

Call default validation within custom validation #405

@Ruud-cb

Description

@Ruud-cb

Requirement:
Have a number of default filter rules setup, all having the contains as operator. Empty values are allowed and should not be filtered on if it is empty.

Unfortunately, the plugin doesn't allow me to get the rules if 1 or more of the rules have an empty value.

From the documentation, I can do a few things:

  • Let the plugin decide the validation
  • Provide own input validation format and messages
  • provide a callback function to do the validation.

Now the only thing I want to do:
Check if it is empty, if it is NOT empty, execute the default validation. If it IS empty, just validate it, filtering on empty values will be handled server-side.

What I would like to have is either:

  • A property in the filter settings, indicating empty values are allowed, something like: allow_empty_value. There is an allow_empty, but that only allows an empty builder).
  • In the custom validation, a callback to the default validation. (Couldn't find it so far, maybe it is there already? Looking at the code I would like to call validateValueInternal, not sure if that can be done in a non-hacky-way.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions