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

Offline membership form script error when outbound email disabled

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7, 4.7.1
    • Fix Version/s: 4.7.8
    • Component/s: CiviMember
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      When outbound email is disabled in System Settings, the offline membership form encounters a javascript error leading to loss of form functionality.

      The problem is in CRM_Membership_Form_Membership::buildQuickForm() with this statement:

          $this->assign('isEmailEnabledForSite', ($mailingInfo['outBound_option'] != 2));
      

      When outbound mail is disabled (option 2) then the Smarty variable is assigned FALSE. This variable is used in the corresponding template as follows:

            var isEmailEnabledForSite = {$isEmailEnabledForSite};
      

      This results in a javascript syntax error:

            var isEmailEnabledForSite = ;
      

      The fix is to assign the value 0 instead of FALSE:

          $this->assign('isEmailEnabledForSite', ($mailingInfo['outBound_option'] != 2) ? 1 : 0);
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              marty Marty Wright
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: