When pushing an entity from Drupal to Salesforce with a field that does not have a value you see a pair of errors:
Notice: Undefined variable: value in salesforce_mapping_property_fieldmap_push_value() (line 318 of /salesforce/modules/salesforce_mapping/includes/salesforce_mapping.fieldmap_type.inc).
Notice: Undefined variable: value in salesforce_mapping_property_fieldmap_push_value() (line 329 of /salesforce/modules/salesforce_mapping/includes/salesforce_mapping.fieldmap_type.inc).
This repeats for each instance of a field with a missing value on the entity. This is due to the $value variable being uninitialized in salesforce_mapping_property_fieldmap_push_value() because it is set within a try. So when the try fails because the field has no value then the $value variable is not set at all resulting in the above notices.
This can be fixed by adding:
$value = NULL;
either within the catch or at the start of the function.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1986966-salesforce-fieldmap-push-value.patch | 712 bytes | gilgabar |
Comments
Comment #1
kostajh commentedThanks for the report @gilgabar. Can you roll a patch for review?
Comment #2
gilgabar commentedI normally wouldn't consider a patch necessary for a one-liner like this. It's easier to copy/paste than to download/apply a patch. But here you go.
Comment #3
kostajh commentedThanks. It makes life a little bit easier - I can just use `drush am 1986966` to review the code (https://drupal.org/project/drush_iq).
Comment #4
kostajh commentedCommitted, thank you!
Comment #5
gilgabar commentedThanks, I hadn't seen drush_iq before. I'll have to give it a try. And thank you for the fast commit.