Hello,<br><br>I'm currently trying to solve a bug report for my module (<a href="http://drupal.org/node/217639">http://drupal.org/node/217639</a>). rallycivic keeps getting a "__clone method called on non-object" when he runs a function in my module. My module runs through a CiviCRM database and pulls out certain CiviCRM contacts that have membership status. The goal is to get this status synchronized to a Drupal role. There is a static method in the CiviCRM API called CRM_Core_BAO_UFMatch::getUFId(). This method will take a CiviCRM contact id and return its corresponding Drupal uid. I then take this list of uids and pass it to the user_multiple_role_edit() function. This function uses the user_save() function to apply role changes. I think that one of rallcivic's uids is causing an issue with this function. From reading the user_save() function's code I can see that it tries to create a new user if the uid doesn't exist. For some reason I think it is trying to do this on a valid uid, which throws a duplicate error that rallycivic has found in watchdog:<br>
<br>"Location        <a href="http://chelmsfordmc.co.uk/admin/settings/civimember_roles/manual_sync" title="http://chelmsfordmc.co.uk/admin/settings/civimember_roles/manual_sync" rel="nofollow">http://chelmsfordmc.co.uk/admin/settings/civimember_roles/manual_sync</a><br>
Referrer        <a href="http://chelmsfordmc.co.uk/admin/settings/civimember_roles/manual_sync" title="http://chelmsfordmc.co.uk/admin/settings/civimember_roles/manual_sync" rel="nofollow">http://chelmsfordmc.co.uk/admin/settings/civimember_roles/manual_sync</a><br>
Message Duplicate entry '' for key 2 query: INSERT INTO users (uid,
created, access) VALUES (404, 1202163268, 1202163268) in
/home/chelmsf/public_html/includes/database.mysql.inc on line 172."<br><br>Then the drupal_clone() function is called on a bogus object and throws the clone method error. At least, that is what I think is happening.<br>
<br>Has anyone ran into a situation similar to this before?<br><br>Neil Goodman<br>