In this patch:
- Compatibility updates for latest salesforce-6.x-2.x-dev
- Implemented default fieldmaps for UC Order and UC Opportunity Contact Role (see uc_sf_order.defaults.inc and uc_sf_order.install)
- Implemented off-the-shelf Opportunity Contact Role node type, complete with field_order_id
- Added user fieldmap selection to settings
- Coding standards: removed a lot of commented-out code, fixed some indenting
- Updated README
- Added dependency on cck
Sorry this is such a big brain dump. At ~1150 lines it's actually a lot of reformatting and some rewriting -- not too much new code. I've had some time the last few days to do some slashing through the salesforce issue queue, and I wanted to make sure I provided some help for this module since it's essentially the only active contrib based on salesforce_api. I'm sure this sill needs some work, namely testing to identify bugs and UI issues.
Right now it's pretty difficult to get an integration up and running with salesforce_api alone, let alone ubercart + salesforce_api + uc_sf.
I would like to see this be plug and play, to the point where it's as simple as:
1. Install module
1.5 Verify / update SF settings
2. Go
I think the default fieldmaps will go a long way towards making this plug and play.
Feedback appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | uc_salesforce_dev_sync.patch | 51.14 KB | EvanDonovan |
| uc_salesforce-update.patch | 49.95 KB | aaronbauman |
Comments
Comment #1
EvanDonovan commentedSo, looking at the CVS messages, this is newer than any of the commits on this module, so I presume that it is necessary in order to get this module to work with the newer dev of Salesforce API.
However, the module will never enable currently b/c of the new line 7 of uc_sf_order.info.
It should be:
dependencies[] = contentsince CCK is the content.module.
I could attach an interdiff, but probably better if you could just re-roll the patch :)
More feedback shortly, after I have a chance to see if I can get this working.
Comment #2
EvanDonovan commentedThe uc_sf_order_default_uc_order_opportunity_field_map & uc_sf_order_default_opportunity_contact_role_field_map default fieldmaps are not showing up for me. I have all the Salesforce API modules enabled. Where are they supposed to appear?
Comment #3
EvanDonovan commentedThe patched version of the module is causing the following error message to show up on cart/checkout/complete whenever an Ubercart order is submitted: "The website encountered an unexpected error. Please try again later."
Nothing else shows up on the page - it is as if I have lost database connection. I have Drupal set to show errors on screen, since this is a test site, but the error is not showing.
Subsequently to this, when I reload the page, I see "SoapFault: INVALID_TYPE: Must send a concrete entity type. in SoapClient->__call() (line 399 of /sites/all/modules/salesforce/salesforce_api/toolkit/soapclient/SforceBaseClient.php)".
Note that I am running Ubercart 2.4. Possibly this patch is no longer compatible with the latest version of Ubercart?
Comment #4
EvanDonovan commentedThe errors I mentioned in #3 were caused apparently by either: a) my field mapping on Opportunity Contact Role, or b) setting Ubercart order contact role to sync to Salesforce OCR in general. (Note: I was not using the OCR node, since it seemed to be causing issues. I will try it again momentarily.)
Below is my field mapping on OCR:
Comment #5
EvanDonovan commentedI can confirm now that the same issue happens also when I map based on the node. Here's the export of that:
I'm wondering whether the ContactId is going missing because uc_sf_order_user_sfid is not getting data in it (likewise, with OpportunityId, most likely). The OCR nodes are getting created, however. (Although they have no titles, which should probably be fixed.)
By the way, I'm bumping this to "major", since uf_sf_order.module is not usable with the latest dev of the Salesforce API module until it is patched, and this patch needs work.
Currently, I have created a sfautogen_organization_name field that is added to $order in _uc_sf_order_do_export. It's a "magic number" right now (i.e., a hard-coded Account ID), but I think I could turn this into a lookup of the Account linked to a Contact based on Contact ID. That way, I would be able to see Donations listed properly on the Account record, even though OCR is not working for me.
I have to figure out, though, why the export on admin/store/orders/%/salesforce is not exporting that field, though, when it is exporting the others. (Possibly I need the submit handler on that form to add it back into the $order object, since it's not actually stored in one of the Ubercart order tables.)
Comment #6
EvanDonovan commentedI figured out that it was just my $account_sfid that wasn't getting populated. This was happening since I was using a Profile node (machine name "profile") for my mapping to Contact, rather than using the profile.module integration provided by sf_user.module.
The following code got that field populated. However, there is still an error happening somewhere in the OCR generation process which is causing "The website encountered an error" to show. I'll look into that further tomorrow.
Comment #7
EvanDonovan commentedI was able to get the OCR mapping working with this patch after I switched to using sf_user instead of sf_node + content_profile.
Therefore, this patch is ready to go except for the issue of the .info file saying "cck" instead of "content". I can re-roll with that, and reset this to "needs review".
Comment #8
EvanDonovan commentedHere's a re-roll of the patch that fixes the issue mentioned in #1, and also adds the fieldmapping urls that were missing previously from the admin interface.
I think you'll have to apply it with patch -p1 if you are inside the uc_salesforce directory. Otherwise, apply it from sites/all/modules.
It should be good to go, except for the potential problems with applying it. I might try within the next week to re-roll using CVS fakeadd to add the files, then CVS diff if it hasn't been reviewed by that point. Once I have a clean re-roll using CVS diff, I will mark it RTBC if no other feedback has come in from Bibek, Aaron, or other reviewers, since this is very similar to Aaron's original patch.
Comment #9
EvanDonovan commentedIf I get commit access to the module, I will also add in #953628: User fieldmap dropdown added to Salesforce API configuration form has no corresponding submit handler logic, which I have working on my copy of the module.
I will release the current dev (prior to the patch) as alpha1, and then release the version that is compatible with the current Salesforce API module as alpha2.
Comment #10
EvanDonovan commentedFixed in alpha2. alpha1 has the code prior to this commit.