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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Trying to use crm_update_contact_membership with civiCRM 1.6 on drupal 4.76
Pages: [1]

Author Topic: Trying to use crm_update_contact_membership with civiCRM 1.6 on drupal 4.76  (Read 2340 times)

vomc8one

  • Guest
Trying to use crm_update_contact_membership with civiCRM 1.6 on drupal 4.76
July 23, 2007, 03:07:50 pm
Hi, i am trying to use the api to update memberships in bulk. my site uses php5. when I try to run this:

Code: [Select]
$params = array(     'id' => $m_id_to_update, 
        'contact_id' => $cid,
'membership_type_id' => $next_type_id,
'start_date' => $next_start_date,
'end_date' => $next_end_date,
'status_id' => $next_status_id,
'is_override' => null,
'reminder_date' => null);

if ($debug) {
p('performing update with the following params');
print_r($params);
}

$result = crm_update_contact_membership($params);
if ($debug) {
p('update done, result:');
        print_r($result);
}

i get the following $result back:

Code: [Select]

performing update with the following params
Array
(
    [id] => 5101
    [contact_id] => 102
    [membership_type_id] => 4
    [start_date] => 19910101
    [end_date] => 19920104
    [status_id] => 4
    [is_override] =>
    [reminder_date] =>
)
update done, result:
Array
(
    [id] => 5101
    [contact_id] => 102
    [membership_type_id] => 4
    [join_date] =>
    [start_date] => 19870101
    [end_date] => 19880101
    [source] => dupecheck
    [status_id] => 4
    [is_override] =>
    [reminder_date] =>
)


it looks like the original membership with id 5101 never actually gets changed. there are also no changes reflected in the civicrm_membership_log table.

i would appreciate any suggestions as to what i may be doing wrong. otherwise I was thinking about having my script just dump the SQL into the civicrm_membership_log table directly....

thanks!
- jochen

Manish Zope

  • I’m new here
  • *
  • Posts: 18
  • Karma: 4
Re: Trying to use crm_update_contact_membership with civiCRM 1.6 on drupal 4.76
August 16, 2007, 04:11:59 am
We will recommend you to upgrade the CiviCRM to latest version
(Upgrade steps : http://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+Drupal+Sites+from+v1.7+to+v1.8 )

Let us know if it solves your problem

Thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Trying to use crm_update_contact_membership with civiCRM 1.6 on drupal 4.76

This forum was archived on 2017-11-26.