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');


$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.

1 Answer 1


I've created an issue and a PR for this fix. See https://issues.civicrm.org/jira/browse/CRM-18447 and https://github.com/civicrm/civicrm-core/pull/8188

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.