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 CiviMember (Moderator: Deepak Srivastava) »
  • CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?
Pages: [1]

Author Topic: CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?  (Read 1719 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?
January 27, 2009, 02:20:34 pm
We have CiviCRM 2.0.5 running on Drupal 5 (upgrading not an option right now) and since March 2008 were not aware that UpdateMembershipRecord.php was available in a cronjob and we were updating memberships manually.

So fast-forward to Jan 23, 2009 when we finally run the script UpdateMembershipsRecord.php (via HTTP) to test it out.

I looked into the results of the member update script and I can't really
figure out what happened, but I think there were some glitches.  Wow this is a long post, sorry, but the glitches were so enormous (and embarrassing for our organization) that I wanted to post them all.

1) This morning I got a call from a member whose membership we renewed on
January 15, 2009 who received the autogenerated email we sent to him Friday about still being
in "Grace." His group is listed as "current" in the membership status
and his "activities" list doesn't show a record of being mailed an email
on Friday.

When I looked at the activities log (138 entries) I noticed....

1. None of the activity logs from Friday's email were logged as Friday
January 23, 2009.  Most say March 29, 2008 (around the time we installed CiviCRM and imported member data) --- but some 2005 and 2002?  Huh?

2. All of Jan 23rd's activities are marked as "scheduled" not "completed"
in the status field.  Does this mean they actually went out, and if so
can we change them and future emails to record as "completed?"  We do not have CiviMail's cronjob going, is this necessary to "send the mail"?

3. Many Partners, at least 30%, were sent "SMS/text messages."  Why?  I spot checked and most of our members have privacy + method settings blank (none checked) with email preference set to "both".  None specify "do not contact".   I could see no difference in my spot checks regarding the privacy settings between a member who received an email and one who received a text/SMS.   Why the SMS messages scheduled?

4. I searched for all "partners" in "grace" membership status and it
returned 151 contacts. But it appears that the Activities log from
Friday only shows 138 activities (i.e. 138 organizations emailed/text
messaged). What accounts for this difference?

6. One of these "missing organizations" that should have received an
email is the Coal Country Watershed Coalition, which doesn't seem to
have received an email (not listed in activities) though their membership's been in
grace for a couple months

Questions:

1) Do you have any insight as to why these glitches occured?  Is it something to do about how long we waited to run this script? 

2) If we run it again will these glitches occur again?

3) How do we cancel "scheduled" emails and SMS/Text messages?  Do we want to cancel them?

4) What can be done to update the dates of these sent emails?




« Last Edit: January 27, 2009, 02:23:47 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?
January 27, 2009, 05:26:09 pm
I recall there being some bugs in that script in 2.0 - although not necessarily matching what you're reporting. Looking at the 2.0 code version, the script should generate an Activity record w/ activity type = 'Membership Signup' for each membership record where it has changed the status of the membership. It does NOT generate a separate activity record when it sounds out the membership reminder email.

Bottom line is that I'm not sure what triggered your spurious SMS activity records (nor the 'scheduled' Email activities). Given the results you're getting I'd probably go back to doing the updates manually until you can upgrade to a newer version. At that time I would also try running the script in a test copy of your install first - where the email outputs are written to a file instead of actually sent.

If other folks using this script in 2.0 have insight - please jump in.
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?
January 28, 2009, 11:15:20 am
That's unfortunate, but I understand.  Due to the sheer amount of errors I think the organization would be hesitant to run it again anyway until we upgrade the software.   It was a rather embarrassing situation to solicit our members who had already renewed.  Here is the thing, though, now that I've got 138 "scheduled" emails and SMS/text how do I clear them all out?  We don't want to send SMS to our members, so I would like to remove these scheduled activities?

Is there a way to do that within the admin interface?

If not, what table in MySQL can I run a query on to remove all the activities where type="scheduled"?

Thanks.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?
January 28, 2009, 02:53:42 pm
I don't know how those records got added - but I do know that there is no mechanism in CiviCRM to actually send an email or an SMS based on the existence of a "scheduled" activity record of type "Email" or "SMS".


That said, if you want to remove them since they are confusing to the users - you'll need to do it via SQL query.
Caveat: Do not do this you're not comfortable with SQL queries!

1. Verify the ID value associated with the SMS activity type in your installation

select value from civicrm_option_value where option_group_id = 2 and name = 'SMS ';

2. Select the SMS activities by activity type id value. If the value from step 1 is 4 (as it is in my 2.0 install):

select * from civicrm_activity where activity_type_id = 4;

3. Assuming the resultset looks correct, then delete them:

delete from civicrm_activity where activity_type_id = 4;

For your email activities, I think you can repeat the steps above using name = 'Email' instead of 'SMS'. However, you may want to add status_id (1=Scheduled) to the select and delete queries - and review to verify you're not removing non-spurious records of emails sent.

select * from civicrm_activity where activity_type_id = 3 and status_id = 1;
Protect your investment in CiviCRM by  becoming a Member!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?
January 28, 2009, 02:54:31 pm
Quote from: Dave Greenberg on January 28, 2009, 02:53:42 pm
I don't know how those records got added - but I do know that there is no mechanism in CiviCRM to actually send an email or an SMS based on the existence of a "scheduled" activity record of type "Email" or "SMS".


That said, if you want to remove them since they are confusing to the users - you'll need to do it via SQL query.

Caveat: Do not do this you're not comfortable with SQL queries and test things out with a COPY of your DB running in a test site.

1. Verify the ID value associated with the SMS activity type in your installation

select value from civicrm_option_value where option_group_id = 2 and name = 'SMS ';

2. Select the SMS activities by activity type id value. If the value from step 1 is 4 (as it is in my 2.0 install):

select * from civicrm_activity where activity_type_id = 4;

3. Assuming the resultset looks correct, then delete them:

delete from civicrm_activity where activity_type_id = 4;

For your email activities, I think you can repeat the steps above using name = 'Email' instead of 'SMS'. However, you may want to add status_id (1=Scheduled) to the select and delete queries - and review to verify you're not removing non-spurious records of emails sent.

select * from civicrm_activity where activity_type_id = 3 and status_id = 1;

Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?
February 02, 2009, 09:10:18 am
Thank you for the excellent directions on how to remove these unwanted Scheduled activities.  Our CiviCRM homepage appears to be back to normal now.

Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • CiviMember ran bin/UpdateMembershipRecord.php, and was super glitchy, what now?

This forum was archived on 2017-11-26.