Node exported on node-add even if automatic export is disabled

Sid_M - July 1, 2009 - 21:50
Project:Salesforce
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

When creating a new field map, not checking the Automatically Populate Salesforce checkbox should mean that nodes will not be automatically exported on creation.

The attached patch fixes salesforce_api_fieldmap_options so it will correctly filter on the automatic field when the function call requests that it does so. Once this is done, the unchecked checkbox is correctly respected.

Although this patch does not address the following, these seem like additional problems with this check box:

There is no way to edit the checkbox once a field map has been created. It would seem that this checkbox should be part of what one has access to when editing the field map, or some other means should be provided to change one's mind about this setting.

Also, to me it doesn't make sense that a node automatically exports on update even if the automatic checkbox is unchecked. It would seem that either both creation and update should export automatically, or neither should. If that linkage is not desired, then we need two checkboxes: one for auto-populate on create; and a second for auto-populate on update.

AttachmentSize
salesforce_filter_by_automatic.patch1.15 KB

#1

Bevan - July 31, 2009 - 05:15

Sid_M, With regards to the patch, I think it make more sense to add a WHERE clause to the SQL instead. However I think that the third parameter ($automatic) of salesforce_api_fieldmap_options() is redundant and should be removed, which would change this patch completely.

The reason I think the $automatic parameter should be removed from salesforce_api_fieldmap_options() is that there is only one case where it is used; in sf_node_nodeapi(). And there it is not used to populate a FAPI element (which is what salesforce_api_fieldmap_options() was meant for). In sf_node_nodeapi() it is used to work out which fieldmap to use for the sf export, and notify the user if there are multiple fieldmaps that apply for the node type.

I created the attached patch to address all of these, but haven't tested it yet, since I'm preserving the passwordExpired state of my SF developer accounts to test a fix for that. Please test and review this patch.

Also, the other issues you described but didn't fix are important. Feel free to submit a patch for those in a new issue node.

Also, please create patches from the root of the salesforce module, according to drupal patch standards. Otherwise your patches are good and clean! :)

AttachmentSize
fix.automatic.patch 4.01 KB

#2

Bevan - July 31, 2009 - 05:16
Title:Only Export a Node on Creation If Automatically Populate Salesforce Is True» Node exported on node-add even if automatic export is disabled

#3

Bevan - July 31, 2009 - 05:42

#4

aaronbauman - September 29, 2009 - 20:03
Status:needs review» reviewed & tested by the community

Here's the patch updated @ DRUPAL-6--2
This is a small enough patch it might as well get rolled into dev ASAP.

AttachmentSize
salesforce-507638.patch 3.91 KB

#5

Bevan - September 29, 2009 - 21:29
Status:reviewed & tested by the community» needs review
 
 

Drupal is a registered trademark of Dries Buytaert.