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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.4 and 4.0 Releases Testing »
  • Asking to view a CiviCampaign Activity and getting a link to a membership
Pages: [1]

Author Topic: Asking to view a CiviCampaign Activity and getting a link to a membership  (Read 1714 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
Asking to view a CiviCampaign Activity and getting a link to a membership
March 02, 2011, 03:50:26 pm
3.4.alpha1 (can't reproduce on 3.4 sandbox as CiviCampaign menus not showing)

I created a survey, "surveyed" a couple of respondents, but when I try and view the generated Activities, I get ...
Quote
Mar 03 10:35:55  [info] $Fatal Error Details = Array
(
    [message] => We experienced an unexpected error. Please post a detailed description and the backtrace on the CiviCRM forums: http://forum.civicrm.org/
    [ code ] =>
)

Mar 03 10:35:55  [info] $backTrace = //sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 277
//sites/all/modules/civicrm/CRM/Core/DAO.php, fatal, 709
//sites/all/modules/civicrm/CRM/Member/Form/MembershipView.php, getFieldValue, 120                                                                   
//sites/all/modules/civicrm/CRM/Core/Form.php, preProcess, 314                                                                                       
//sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php, buildForm, 99                                                                     
//sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203                                                                     
//sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103                                                                             
//sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 284                                                                                     
//sites/all/modules/civicrm/CRM/Member/Page/Tab.php, run, 178                                                                                         
//sites/all/modules/civicrm/CRM/Member/Page/Tab.php, view, 273                                                                                       
//sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 219
//sites/all/modules/civicrm/drupal/civicrm.module, invoke, 355
, civicrm_invoke,
//includes/menu.inc, call_user_func_array, 348
//index.php, menu_execute_active_handler, 18

Before I get the error I'm on the page whose URL is /civicrm/activity/search?_qf_Search_display=true&qfKey=82b672fa7963e7c356ffb82d1f229ae0_5664 (I have just searched for activities of type "Survey"). I get the error when I click on the "View" link which has the URL /civicrm/contact/view/membership?action=view&reset=1&id=2&cid=10222&context=search&key=82b672fa7963e7c356ffb82d1f229ae0_5664

It seems to be a bug to ask to view an Activity and be shown a Membership? (I don't have CiviMember activated.)

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: Asking to view a CiviCampaign Activity and getting a link to a membership
March 10, 2011, 10:01:33 pm
This is still an issue with 3.4.alpha2

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: Asking to view a CiviCampaign Activity and getting a link to a membership
March 10, 2011, 10:24:10 pm
I cannot reproduce this on the 3.4 Drupal sandbox

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: Asking to view a CiviCampaign Activity and getting a link to a membership
March 11, 2011, 09:49:35 pm
I think I've found the cause. With reference to the 3.4.alpha2 code ...

When doing an Activity Search ( /civicrm/activity/search?reset=1 ) the list of activity types in the form is populated using ...
Code: [Select]
        $activityOptions = CRM_Core_PseudoConstant::activityType( true, true, false, 'label', true );... on line 420 of /CRM/Activity/BAO/Query.php, so the list includes campaign activities because the $includeCampaignActivities argument is set to 'true'.

When I select 'Survey' (a campaign activity) and press 'Search', the results are displayed, and as they are displayed, the code works out which action links to display. In /CRM/Activity/Selector/Search.php the following code on lines 286-287 maps the Activity Type name 'Survey' to Activity Type Ids ...
Code: [Select]
            $activityType = CRM_Core_PseudoConstant::activityType( true, true );
            $activityTypeId = CRM_Utils_Array::key( $row['activity_type'], $activityType );

'Survey' is not included in the list of Activity Types because the $includeCampaignActivities argument defaults to 'false'. $activityTypeId is left NULL.

On lines 137-141 of /CRM/Activity/Selector/Activity.php the following code sets the Action Link URL ...
Code: [Select]
        } elseif ( in_array($activityTypeId,
                            array( $activityTypeIds['Membership Signup'], $activityTypeIds['Membership Renewal'] )
                            ) ) {  // membership
            $url      = 'civicrm/contact/view/membership';
            $qsView   = "action=view&reset=1&id={$sourceRecordId}&cid=%%cid%%&context=%%cxt%%{$extraParams}";

In my configuration, the CiviMember component is disabled, so both $activityTypeIds['Membership Signup'] and $activityTypeIds['Membership Renewal'] are NULL, so 'in_array' matches.

Line 286 of /CRM/Activity/Selector/Search.php should be changed to include Campaign activities. The function actionLinks() in /CRM/Activity/Selector/Activity.php should be changed to work even if some components are disabled.

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: Asking to view a CiviCampaign Activity and getting a link to a membership
March 14, 2011, 10:32:49 pm
I think that CRM-7607 and CRM-7769 will solve this problem for me.

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: Asking to view a CiviCampaign Activity and getting a link to a membership
March 18, 2011, 03:24:44 pm
Resolved in 3.4.alpha3

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.4 and 4.0 Releases Testing »
  • Asking to view a CiviCampaign Activity and getting a link to a membership

This forum was archived on 2017-11-26.