From 32ad91520b2063f29a0cf926f0f755fc59a5e52c Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Thu, 11 Feb 2016 18:06:38 -0500 Subject: [PATCH] CRM-17029 - Add to Group profile setting doesn't work on petitions --- CRM/Campaign/Form/Petition/Signature.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Campaign/Form/Petition/Signature.php b/CRM/Campaign/Form/Petition/Signature.php index 0693788fe0..a8a477622f 100644 --- a/CRM/Campaign/Form/Petition/Signature.php +++ b/CRM/Campaign/Form/Petition/Signature.php @@ -482,7 +482,9 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form { $transaction = new CRM_Core_Transaction(); - $addToGroupID = isset($this->_addToGroupID) ? $this->_addToGroupID : NULL; + // CRM-17029 - get the add_to_group_id from the _contactProfileFields array. + $firstField = array_shift(array_slice($this->_contactProfileFields, 0, 1)); + $addToGroupID = isset($firstField['add_to_group_id']) ? $firstField['add_to_group_id'] : NULL; $this->_contactId = CRM_Contact_BAO_Contact::createProfileContact($params, $this->_contactProfileFields, $this->_contactId, $addToGroupID, $this->_contactProfileId, $this->_ctype, -- 2.25.1