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

Giftaid module problem: Profile fields in a contribution required even when GiftAid not selected

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.2.0
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      The GiftAid profile has do you want to use gift aid, First name, Last name, first line of address and postcode required. However we do not need all these fields if the first question is no. So I've added this code to the civicrm_giftaid.module file.

      AFTER:
      function civicrm_giftaid_civicrm_validate( $formName, &$fields, &$files, &$form ) {
      $errors = array( );

      NEW CODE:

      if($formName=='CRM_Contribute_Form_Contribution_Main'){
      if(isset($fields['custom_7']) && $fields['custom_7']!=true)

      { // custom_7 is eligible for GiftAid? $form->setElementError("first_name", null); $form->setElementError("last_name", null); $form->setElementError("street_address-Primary", null); $form->setElementError("postal_code-Primary", null); }

      }

        Attachments

          Activity

            People

            • Assignee:
              michaelmcandrew Michael McAndrew
              Reporter:
              alib Ali Bakir
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: