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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • bug with activities schedule?
Pages: [1]

Author Topic: bug with activities schedule?  (Read 1362 times)

Larry Gordon

  • Guest
bug with activities schedule?
January 06, 2009, 10:01:27 am
Most times, but not always, when we renew memberships or record new contributions in a contact file, the system generates a notice for a scheduled Text Message or Phone Call for that contact file, which then appears on the CiviCRM home page. This is being generated by they system, not by us actually scheduling these activities. In fact, we've never used the activities scheduling function.

Is this some type of bug? Has anyone else experienced this problem?


Larry,

Toronto, ON


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: bug with activities schedule?
January 06, 2009, 02:53:13 pm
Sounds like a bug  and / or a mismatch between the activity type ID's in the code and the ones which are present in your DB. I remember this coming up on the forums a while ago so you might do some searches and see if you find a relevant post. Also please update your forum profile to show the version of CiviCRM you are using as well as your CMS, PHP version and MySQL version.
Protect your investment in CiviCRM by  becoming a Member!

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: bug with activities schedule?
January 07, 2009, 02:29:36 pm
Hi Dave:

I'm the developer/host for this site.

Yes, i saw some similar issues (on a 2.1 upgrade), and it's possible the sms/phone calls are supposed to be a different activity, but what are they supposed to be? The off-line donations trigger the membership updates and then also these mystery activities at the same time (with the same subject). So I assume the activity is being generated by the membership cron code.

Re: versions - it's

Drupal 5
PHP 5.1
Mysql 5.0
CiviCRM 2.0.6

Also, i just noticed it happenning on a different install (same version).

Re: phone/sms - the older ones are sms, then it magically switched to phone after some months.


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: bug with activities schedule?
January 08, 2009, 10:36:24 am
Hi Alan - If a membership is renewed with "Record Payment" checked, then two activity records are inserted:

* A "Membership Renewal" activity - which is activity_type_id =  8 in the default installs for 2.0 and 2.1
* A  "Contribution"  activity - which is activity_type_id = 6

There were some "bugs" in the code where the activity_type_id value was hard-coded rather than looked up via "civicrm_option_value.name" (which we now use as our reliable handle for all these "enums"). If the phone / sms activities are "bogus" - then it might work just to align the activity type option values in the site with the default set (in sql/civicrm_data.mysql). Grab us on IRC if questions.
Protect your investment in CiviCRM by  becoming a Member!

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: bug with activities schedule?
January 14, 2009, 02:02:49 pm
Hi Dave:

okay, that makes sense, but it looks more complicated than that in this case. Maybe this would help:

Code: [Select]
select * from civicrm_activity where source_contact_id = 14361;
+------+-------------------+------------------+------------------+---------------------------------------------------------------------+---------------------+---------------+----------+----------+----------+--------------+---------+-----------+-------------+-----------+---------+
| id   | source_contact_id | source_record_id | activity_type_id | subject                                                             | activity_date_time  | due_date_time | duration | location | phone_id | phone_number | details | status_id | priority_id | parent_id | is_test |
+------+-------------------+------------------+------------------+---------------------------------------------------------------------+---------------------+---------------+----------+----------+----------+--------------+---------+-----------+-------------+-----------+---------+
| 6861 |             14361 |             6326 |                6 | $ 10.00 - Offline membership signup (by xxxxxxxxxxxxxxx@xxxxxx.com) | 2009-01-03 21:51:00 | NULL          |     NULL | NULL     |     NULL | NULL         | NULL    |         2 |        NULL |      NULL |       0 |
| 6862 |             14361 |             3382 |                7 | Donation - Status: New                                              | 2009-01-03 00:00:00 | NULL          |     NULL | NULL     |     NULL | NULL         | NULL    |         2 |        NULL |      NULL |       0 |
| 6982 |             14361 |             NULL |                2 | Donation -                                                          | 2009-01-03 00:00:00 | NULL          |     NULL | NULL     |     NULL | NULL         | NULL    |         1 |        NULL |      NULL |       0 |
+------+-------------------+------------------+------------------+---------------------------------------------------------------------+---------------------+---------------+----------+----------+----------+--------------+---------+-----------+-------------+-----------+---------+
3 rows in set (0.00 sec)

It's that third record that's the irritant, and:

1. it's set to a status of 1 (scheduled) - that's what makes it irritating.
2. from the id number, it looks like it is generated after the membership-cron generated one, (but still possibly by the same script?).
3. the activity type id is 2. We haven't done anything to customize the activities, so I don't believe the problem is related to the activity label mapping. I'm also not sure why these phantom entries started off as sms entries (except maybe we disabled sms at some point?)

Does that add any more clues to what's going on?

One more clue ... we did fiddle with the Membership status rules. One of the changes was to reduce the "New" End Event Adjustment to 1 day from 30 days. I wonder if that's confusing some rule? The "Current" status runs from Start to End (No change) and we disabled the Pending "Status" [hmm .. that looks suspicious, when I edit it, it looks active]. I wonder if the abstractions around membership transitions might be so complicated that it's generating phantom entries somehow?
« Last Edit: January 14, 2009, 02:16:11 pm by adixon »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: bug with activities schedule?
January 14, 2009, 02:35:03 pm
Alan - at this point I think you're best bet is to instrument some debug statement(s) in the class(es) that you think might be generating the phantom activity entries. Not sure what sequence of events you're eyeballing since the one script in CiviMember which is designed to be cron-driven - bin/UpdateMembershipRecord.php - doesn't create new memberships and doesn't generate contributions - it only updates membership statuses and sends renewal reminders.

Based on it's subject line, the 1st activity in the triplet ("Offline membership signup ..")  is generated by CRM/Member/Form/Membership.php (I think in postProcess although I didn't review the code). If you think this is the user action that triggers these - you can recreate by going to a test Contact record, Membership tab >> New Membership with Record Payment = True.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • bug with activities schedule?

This forum was archived on 2017-11-26.