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

Cannot create Survey if Events have 'is required' custom data

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.6
    • Fix Version/s: 4.7.7
    • Component/s: CiviCampaign
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      This is an issue with 4.7.6 and its reproducible on the Drupal 7 demo site.

      1. Create a custom field called 'X' for Events that is required
      2. Attempt to create a Survey via civicrm/survey/add (enter values and press 'Continue')

      Step 2 fails with the error 'X is a required field'

      The issue can be fixed by changing line 83 of CRM/Campaign/Form/Survey.php ...

      $this->set('type', 'Event');

      to

      $this->set('type', 'Survey');

      This change fixes the problem, but I'm unsure whether there is a deeper issue.

      The form that is used by civicrm/survey/add is CRM/Campaign/Form/Survey/Main.php. The parent form is CRM/Campaign/Form/Survey.php. The possibly deeper issue is that the preProcess function of both forms (Main.php and Survey.php) deals with Custom Data.

      I feel the child form (Main.php) should leave it to its parent to deal with Custom Data. But I think someone from the Core team might need to look at that.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ken Ken West
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: