CiviCRM

CRM_Core_Form::validate returns incorrectly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed/Completed
  • Affects Version/s: 3.1.3, 3.1.4, 3.1.5
  • Fix Version/s: 3.2
  • Component/s: None
  • Labels:
    None

Description

Using hook_civicrm_validate, a developer could unset validation errors, but the form will still not pass to submit to submission because CRM_Core_Form::validate() returns an out-dated value.

Instead, the function return in the same way as it's parent, by checking the count of _errors. See HTML_Quickform::validate().

The attached one-line patch fixes this, and makes hook_civicrm_validate immensely more useful.

Activity

Hide
Matt Chapman added a comment -
That should say, "Instead, the function SHOULD return in the same way..."
Show
Matt Chapman added a comment - That should say, "Instead, the function SHOULD return in the same way..."

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
10m
Original Estimate - 10 minutes
Remaining:
10m
Remaining Estimate - 10 minutes
Logged:
Not Specified
Time Spent - Not Specified