Closed (fixed)
Project:
Salesforce Suite
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Nov 2009 at 16:56 UTC
Updated:
14 Jun 2011 at 19:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
aaronbaumanThis patch runs values through
htmlentitiesduringsalesforce_api_fieldmap_export_create, so that special html characters are encoded before SOAP gets its hands on the sobject.I have used this patch with some success, but I don't think it's a complete solution to this issue.
Comment #2
aaronbaumancommitted http://drupal.org/cvs?commit=330970
I still suspect that this patch is insufficient, but I don't have any actual cases.
Please report any specific failures in this issue and re-activate.
Comment #3
kostajh commentedAccording to Salesforce docs, these are reserved characters (for searches anyway):
? & | ! { } [ ] ( ) ^ ~ * : \ " ' + -The docs specify that a backslash needs to go before each reserved character. How do you all feel about doing that instead of running export fields through htmlentities?
Comment #4
kostajh commentedHere is a patch for testing. I have not had a chance to test it out myself yet.
Comment #5
kostajh commentedSo, this works to some extent. Instead of seeing '& amp;' for an "&", I now see "\&". The problem is that the backslash shouldn't be in SF, because the next time I run an import for that user, I'll then have "\\\&" in Drupal. Does anyone have ideas on this? I've been searching through the Salesforce forums and found other people asking about the issue, but no answers.
Comment #6
kostajh commentedOk, buried in the Salesforce developer docs is a little note that says the encoded data is usually handled for you by the SOAP client. Sure enough, if we remove the calls to htmlentities(), the SOAP client handles the encoding for us just fine. I tested all the reserved characters from #3 without any issues. I suspect in Nov '09 when this issue was filed, the SOAP client did not handle the encoding.
Attached patch removes use of htmlentities().
Comment #7
kostajh commentedCommitted: http://drupalcode.org/project/salesforce.git/commit/24f441b