8000 Custom Validation Rule & allowEmpty · Issue #8925 · cakephp/cakephp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Custom Validation Rule & allowEmpty #8925
Closed
@wilsmex

Description

@wilsmex

This is a (multiple allowed):

  • bug
  • enhancement
  • feature-discussion (RFC)
  • CakePHP Version: 3.2

What you did

I need to have my custom validation rules determine whether or not a field should be required or not. This is currently impossible as:

  1. if you set allowEmpty the custom validation rule will not fire if the field is left empty
  2. if you set your custom validation rule, the field is forced to be required before the custom validation rules will trigger.

Expected Behavior

When I create a custom validation rule, it should run it's logic and return true/false whether or not the field is left empty or not.

Actual Behavior

When a custom validation rule is in place, a field cannot be left blank and forces data before the custom validation rules execute.

See http://stackoverflow.com/questions/37176984/cakephp-3-x-custom-validation-field-required

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0