Problem/Motivation

When adding an action for "Form Field : Set Validation Error", the help description indicates that an empty value is supported. It appears as if this is actually a required field that needs a value.

Steps to reproduce

Create a simple model that sets a validation error.

  1. Event: Validate form -- I used node.article as a test.
  2. Action: Set validation error; leave the "field name" blank.
  3. Create article node. No validation error will be set.
  4. Go back and add a field name in the action (e.g., body). Now attempting to the save the article sets the validation error.

This appears to have been fixed in 1.2.x but is still affecting 2.0.x.

Comments

jwineichen created an issue. See original summary.

  • jurgenhaas committed 139a4af2 on 2.1.x
    Issue #3484484 by jwineichen, jurgenh: Set Validation Error, empty value...
jurgenhaas’s picture

Version: 2.0.7 » 2.1.x-dev
Status: Active » Needs review
Issue tags: +backport

Bug reports always have to go against the latest dev release and will then be back ported if necessary.

The code in 2.x contains everything from 1.2, but the problem wasn't properly solved there either. The field name can indeed be left empty as mentioned in the field description: "Leave empty to set a global error on the form."

The problem was, that the access control method didn't know about that special case and didn't allow for the empty field name. This should be fixed with the latest commit. Please test this out and set the issue to RTBC if it solves the problem. We can then back port and fix this.

jwineichen’s picture

Status: Needs review » Reviewed & tested by the community

Commit tested, both on the generic example listed above and a separate webform-based model. Both successfully set the validation error on the entire form without a field name listed.

  • jurgenhaas committed cb71a740 on 2.0.x
    Issue #3484484 by jwineichen, jurgenh: Set Validation Error, empty value...
jurgenhaas’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @jwineichen

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.