CRM-13046
authoryashodha <yashodha.chaku@webaccess.co.in>
Fri, 19 Jul 2013 13:03:03 +0000 (18:33 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Fri, 19 Jul 2013 13:03:03 +0000 (18:33 +0530)
CRM/Campaign/Form/Petition.php

index 7cfd51df2f6274dfaa6ea99c951620da3286e558..709cd644508dd4af682ee7b2a47d4c899b2ea157 100644 (file)
@@ -131,14 +131,23 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
   function setDefaultValues() {
     $defaults = $this->_values;
 
-    $ufJoinParams = array(
+    $ufContactJoinParams = array(
       'entity_table' => 'civicrm_survey',
       'entity_id' => $this->_surveyId,
       'weight' => 2,
     );
 
-    if ($ufGroupId = CRM_Core_BAO_UFJoin::findUFGroupId($ufJoinParams)) {
-      $defaults['contact_profile_id'] = $ufGroupId;
+    if ($ufContactGroupId = CRM_Core_BAO_UFJoin::findUFGroupId($ufContactJoinParams)) {
+      $defaults['contact_profile_id'] = $ufContactGroupId;
+    }
+    $ufActivityJoinParams = array(
+      'entity_table' => 'civicrm_survey',
+      'entity_id' => $this->_surveyId,
+      'weight' => 1,
+    );
+
+    if ($ufActivityGroupId = CRM_Core_BAO_UFJoin::findUFGroupId($ufActivityJoinParams)) {
+      $defaults['profile_id'] = $ufActivityGroupId;
     }
     
     if (!isset($defaults['is_active'])) {