Porting Contrib Modules from 6.x to 7.x: API Changes
Since the Salesforce Suite was refactored to be based around entities in the 7.x branch, that has necessitated some major schema and API changes. The following is a fairly complete list of these. If any schema or API changes that affect porting modules from 6.x are found to be missing from this list, please add or update the list below.
- primary key is (name, oid) on {salesforce_object_map}
- changed the {salesforce_field_map} table to {salesforce_fieldmap}, for consistency with much of the code which speaks of "fieldmaps"
- {salesforce_object_map} and {salesforce_fieldmap} have drupal_entity and drupal_bundle columns
- changed the CTools export to "salesforce_fieldmap" instead of "salesforce_field_map"
- changed the functions that have field_map in their names to fieldmap
- removed the redundant "wrapper functions" for loading and saving
most significantly, there is only a salesforce_api_salesforce_fieldmap_load function, instead of also a salesforce_api_fieldmap_load function
salesforce_api_fieldmap_load had been referenced in numerous places in the code of modules besides salesforce_api.module
- changed the parameters for the salesforce_api_fieldmap_objects_load function, which loads the fieldmaps defined for a particular Drupal or Salesforce object
function salesforce_api_fieldmap_objects_load($type, $entity = NULL, $bundle = NULL, $reset = FALSE)
( was $type, $name, $reset previously)
- Added an optional drupal_bundle parameter to the object deletion function.
function salesforce_api_delete_object_map($drupal_type, $oid, $drupal_bundle = NULL)
- Added an optional $bundle parameter to salesforce_api_id_load.
function salesforce_api_id_load($oid, $entity_name, $bundle_name = NULL)
- Added a required $bundle_name parameter to salesforce_api_id_save.
function salesforce_api_id_save($oid, $sfid, $name, $entity_name, $bundle_name)
- Added return values to the fieldmap and object deletion functions.
- Changes to the salesforce_api_fieldmap_options and salesforce_api_fieldmap_object_label function signatures so they support entity/bundle
function salesforce_api_fieldmap_options($drupal_entity = NULL, $drupal_bundle = NULL, $salesforce = NULL, $automatic = NULL)
function salesforce_api_fieldmap_object_label($type, $entity, $bundle)
- Some changes to hooks, documented in hooks.php, including removing the $changes parameter from pre and post-import hooks
(Note that if that is necessary, it may be added back in.)
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion