Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14310

No way to throw custom errors on Event Info and Settings page using hook_civicrm_validateForm

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.4
    • Fix Version/s: 4.5
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      There doesn't seem to be a way to throw custom errors using hook_civicrm_validateForm on the Event Info and Settings page. We've tracked this down to a line in CRM/Event/Form/ManageEvent.php that sets "isForm" to "FALSE" for this form, which I believe was done to allow for the new javascript form validation code.

      Removing "self::$_template->assign('isForm', FALSE);" from around line 383 allows for custom validation errors to be thrown using hook_civicrm_validateForm and doesn't appear to break anything with the form. Is there a reason that line still needs to be there? There's a comment above that says "hack lets suppress the form rendering for now" which makes me think this was added a bit hastily in the first place.

      Any thoughts?

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              anemirovsky Anthony Nemirovsky
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: