I've done some more testing based on the current salesforce.module and the patch which was released by eojthebrave (see http://drupal.org/node/190631)

1. created Account (Salesforce)
- name: Company
- filled out type, industry, Billing Address, rating, phone, fax, website, ownership

2. created contact (Salesforce -> Drupal)
- name: Test Contact1
- account: Company
- filled out fields phone, home phone, mobile, other phone, fax, email (existing one)
- results (recent log entries)

  • user - New user: TestContact1 .
  • salesforce - Inserted user TestContact1 from Salesforce

- edited user account (to check entries)

  • fields username, email filled out
  • status: blocked
  • checked: create a lead in salesforce

problems:

  • I think the checkbox "create a lead in salesforce" shouldn't be checked!
  • New user is blocked. I think user should be active. I tried to login with this login data, but ... no way, user is blocked.

3. updated contact (Drupal -> Salesforce)
- name: Test Contact1
- changed fields: status, create a lead in salesforce, phone
- messages on screen

  • Updated contact in salesforce for the user Test Contact1
  • The changes have been saved.
  • An event was created in salesforce for the user Test Contact1

- problems

  • I can't uncheck checkbox "create a lead in salesforce", i.e. changes won't be saved (after saving and editing the checkbox is still active).

- run cron
- results (recent log entries)

  • salesforce - Updated TestContact1 from Salesforce

- problems

  • phone number was updated in Salesforce
  • After cron run the email address disappeared in Drupal. I've checked the user table. The entry for email moved from the field mail to init. In Salesforce the email address is still there. Everytime I run a cron the message "salesforce - Updated TestContact1 from Salesforce" is written to the log.

4. delete contact (Salesforce -> Drupal)
- name: Test Contact1
- after a few cron runs user still available and active in Drupal...

Comments

eojthebrave’s picture

Thanks for all the effort you put into testing this. I've been working on some code that will hopefully help fix a number of these problems and should have it ready in the next day or two.

One thing that I think is more by design, and not really a bug per say ...

New user is blocked. I think user should be active. I tried to login with this login data, but ... no way, user is blocked.

I think this is a result of running cron.php while logged in to the site as an administrator. That was the only way to I could replicate the problem.

The code calls the user_register_submit() function directly, and spoofs the form_values array that this function expects. The function deals with assigning the users 'status' upon creation, and contains this code

  if (!$admin) {
    // Set the user's status because it was not displayed in the form.
    $merge_data['status'] = variable_get('user_register', 1) == 1;
  }

I think this is what's causing your accounts created from Salesforce Contacts to be "blocked".

victorkane’s picture

Category: bug » task

changing to task (not bug)

This is great, the effort in testing and the effort in reworking the patch, I hope the patch can be reissued with the changes. I will then commit it.

Since the patch was never committed, however, this is not a bug, but a task associated with feature request with a supplied patch. (It is not a bug of the salesforce development release, per se).

Thanks again, hope to see the new version of the patch which fixes this, then I will include it in the development release.

Victor Kane
http://awebfactory.com.ar

eojthebrave’s picture

Status: Active » Closed (duplicate)

Posted a new patch in this thread http://drupal.org/node/190631#comment-649611 with updates that fix most of things mentioned above.

One notable thing that still needs to be addressed is this

I can't uncheck checkbox "create a lead in salesforce", i.e. changes won't be saved (after saving and editing the checkbox is still active).

Also, it's probably worth noting that Salesforce doesn't seem to make your updates available to the API queries immediately after you make them, which is why for example deleting a Lead in Salesforce may not be "mirrored" in Drupal until a little later. It's also the reason that a lot of the queries I'm sending to Salesforce are back dated by 600 seconds. So that if you do run the cron.php script before Salesforce has made that update available to the API it doesn't just get skipped when queries are dated with the time of the last successful cron run.

Thanks again for all the testing bjacob. I appreciate the help.

Finally, I'm marking this as a duplicate of this thread so that we can try and keep all of this in one place.