CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • Petition Activity Profile doesn't capture data
Pages: [1]

Author Topic: Petition Activity Profile doesn't capture data  (Read 1831 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Petition Activity Profile doesn't capture data
February 06, 2013, 12:18:38 am
I can reproduce this on the 4.2 demo site for Drupal 7 ...

* create a Petition that uses an Activity Profile
* my Activity Profile has 2 fields: Details is mandatory; Engagement Index is non-mandatory
* when signing the Petition, neither shows as mandatory
* after signing, neither field is captured
* also, the Petition Activity's Campaign field is NULL (I expected it would be set to the Petition's Campaign)

Ken

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Petition Activity Profile doesn't capture data
February 06, 2013, 11:46:47 am
Ken - if you can reproduce on sandbox

http://sandbox.drupal.civicrm.org/ I would definitely log this in JIRA.

If it's in 4.3 it definitely needs fixing.

Not sure if there will be another release of 4.2 so less sure about that.

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Petition Activity Profile doesn't capture data
February 06, 2013, 12:51:33 pm

You might want to ping xavier on irc on this since he wrote and maintains petition and all fixes are based on him investigating and fixing

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Petition Activity Profile doesn't capture data
February 06, 2013, 01:05:02 pm
I see that in The Book that the process is to add a custom field to Activities, and then access that via a profile.

That would make this the use of non-custom fields an enhancement.

Yet the failure to capture the Campaign still seems to me to be a defect.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Petition Activity Profile doesn't capture data
February 07, 2013, 02:56:59 am
Hi,

You have put custom activity fields in the profile, it's saved properly but the campaign isn't or are you only using the default fields from activity?

I never used standard fields in a petition and haven't heard about someone doing it, but can understand how it would be useful. Would you want to have a go at fixing it?

Campaign id gone missing might be another issue.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Petition Activity Profile doesn't capture data
March 04, 2013, 03:08:27 pm
Xavier,

Just to clarify, I'm now using a custom field and no default fields from the Activity. That works fine. However the Campaign Id is not saved into the Activity that is created.

Ken

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Petition Activity Profile doesn't capture data
March 07, 2013, 02:29:55 am
Xavier,

Here is a patch to fix the missing Campaign Id

--- /data/Download/CiviCRM/civicrm-4.3.beta1-drupal/./CRM/Campaign/Form/Petition/Signature.php   2013-02-08 23:31:05.000000000 +1100
+++ /data/Work/IT/CiviCRM/Local/4.3.beta1/cbf/php/./CRM/Campaign/Form/Petition/Signature.php   2013-03-07 21:03:38.947786311 +1100
@@ -523,6 +523,7 @@
 
     // create the signature activity record
     $params['contactId'] = $this->_contactId;
+    $params['activity_campaign_id'] = $this->petition['campaign_id'];
     $result = $this->bao->createSignature($params);
 
     // send thank you or email verification emails
--- CRM/Campaign/BAO/Petition.php   2013-02-08 23:31:05.000000000 +1100
+++ CRM/Campaign/BAO/Petition.php   2013-03-07 20:34:54.935237397 +1100
@@ -206,6 +206,7 @@
         'activity_type_id' => $surveyInfo['activity_type_id'],
         'activity_date_time' => date("YmdHis"),
         'status_id' => $params['statusId'],
+        'activity_campaign_id' => $params['activity_campaign_id'],
       );
 
       //activity creation

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Petition Activity Profile doesn't capture data
March 07, 2013, 02:34:44 am
Xavier,

Here is a patch to fix the missing Campaign Id

Quote
--- CRM/Campaign/Form/Petition/Signature.php   2013-02-08 23:31:05.000000000 +1100
+++ CRM/Campaign/Form/Petition/Signature.php   2013-03-07 21:03:38.947786311 +1100
@@ -523,6 +523,7 @@
 
     // create the signature activity record
     $params['contactId'] = $this->_contactId;
+    $params['activity_campaign_id'] = $this->petition['campaign_id'];
     $result = $this->bao->createSignature($params);
 
     // send thank you or email verification emails
--- CRM/Campaign/BAO/Petition.php   2013-02-08 23:31:05.000000000 +1100
+++ CRM/Campaign/BAO/Petition.php   2013-03-07 20:34:54.935237397 +1100
@@ -206,6 +206,7 @@
         'activity_type_id' => $surveyInfo['activity_type_id'],
         'activity_date_time' => date("YmdHis"),
         'status_id' => $params['statusId'],
+        'activity_campaign_id' => $params['activity_campaign_id'],
       );
 
       //activity creation

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Petition Activity Profile doesn't capture data
March 07, 2013, 03:13:58 am
Thx ken,

Added the issue http://issues.civicrm.org/jira/browse/CRM-12046

Not sure what's the process for 4.2, but going the fix the git way for 4.3
Pull request:
https://github.com/civicrm/civicrm-core/pull/78/files
« Last Edit: March 07, 2013, 03:52:41 am by xavier »
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • Petition Activity Profile doesn't capture data

This forum was archived on 2017-11-26.