Some node object values set in sf_node_export instead of using import/export handlers

legion80 - September 17, 2009 - 19:23
Project:Salesforce
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Hello,

I am using an installation of OpenAtrium beta3.1, which uses the Content Profile module. I mapped my sf object to the "Profile" content type. The sf object's email field was mapped to "Author's email" under the "Core fields" section in the drop down.

When I go to the user's corresponding Profile node (it would be nice, by the way, to be able to have both the user node and the profile node available for export/import in the salesforce tab user/#/salesforce), the Author's email comes up as blank.

#1

legion80 - September 17, 2009 - 19:25

Oh one last detail-- I turned off the automatic syncing, and I used the Object Setup patch.

#2

aaronbauman - September 17, 2009 - 19:59

do any other fields or field types work?

#3

legion80 - September 18, 2009 - 13:59

Outside of the CCK fields, which do sync correctly, I am only syncing the 'Author's email' field in the core node.

It is possible that the syncing is actually happening, now that I look at the data via Apex explorer. It's just that in the Salesforce tab, the Author's email appears as blank in the form. I will do some more testing to be sure.

BTW, until the checkbox for changing sync-ing is available in the edit form, is it ok to just change the automatic column in the fieldmap sql table?

#4

legion80 - September 24, 2009 - 19:04

Ok so I have verified that the Author's email does get created and pushed to salesforce when it syncs up the first time. But in the Salesforce tab the author's email just appears blank on the Drupal side, but shows up on the Salesforce side.

#5

aaronbauman - September 29, 2009 - 17:02
Title:Author's email appears as blank with Content Profile» Some node object values set in sf_node_export instead of using import/export handlers
Status:active» needs review

You should notice some idiosyncrasies with the "(blank)" and "Created timestamp" fields as well.
These values were being set improperly in sf_node_export, rather than using their own export functions.

In addition, they were never being imported [perhaps this is by design]. Importing an author's username≈ or email raises some interesting questions:
1. Should $user object corresponding to $node->uid be altered? Or should $node->uid be altered to match a user who's name/mail match the new value?
2. In the former case - how is the user supposed to find their account now that their username and/or email address just changed?
3. In the latter case - what if the new author doesn't have the appropriate roles/permissions to use the node they now own?

With this in mind, I attach 2 patches:
1. 580632-cowardly-sf_node.module.patch - properly implements "export only" functionality for author's email. I think this patch, after getting RTBC, is the one that should get rolled into the next release.
2. 580632-sf_node.module.patch - properly implements "export" functionality for mail. implements "import" functionality for email and username and attempts to reassign $node->uid based on the imported values. I think this patch is going to be more extensive, and probably merits further discussion. For example, maybe admins can specify how they want to resolve the dilemma outlined above.

Both patches properly implement import/export for "(blank)" and "Created timestamp" fields and address the original issue in this ticket.

AttachmentSize
580632-cowardly-sf_node.module.patch 2.79 KB
580632-sf_node.module.patch 4.46 KB
 
 

Drupal is a registered trademark of Dries Buytaert.