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.
- Create a custom field called 'X' for Events that is required
- 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.