Needs review
Project:
Field Validation
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2012 at 10:18 UTC
Updated:
22 Oct 2015 at 08:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
b-prod commentedThe patch below fixes such issue. But due to a Drupal core bug that is discussed here (#289452: FAPI: Error class is not set if error message is empty), the following patch against Drupal core need to be applied: http://drupal.org/node/289452#comment-3039426.
The question is: should we test that the patch has been applied and provide a fallback behavior if not?
It could be quite simple by calling
form_get_error($element)after havin thrown an empty message. If it return an empty string, we can consider that the patch was not applied anf call againform_error()with the message.But I am not sure that adding more code to handle Drupal core issue is a good thing. Moreover, only the "one of several" validation rules are concerned by this Drupal bug.
Comment #2
Anonymous (not verified) commentedHi B-Prod, thanks for providing a patch for this. Unfortunately it does not apply to 7.x-2.x-dev - any chance you could re-roll it?
Comment #3
FreeFox commentedI want to second this request. However, patching the core is 1 thing I'm not allowed to do. Is it possible to patch only the validation module to do the trick?
Thanks in advance. Keep up the good work.
Comment #4
b-prod commentedThis patch applies against current DEV version.
Note that this patch still needs the patch against Drupal Core.
Comment #5
philyA cleaner solution avoiding patching is suggested by ialexandri at https://www.drupal.org/node/2085103