UpRPC implements hook_transport_TYPE_prefilter_alter(), an alter hook from transport module which lets us make all sorts of changes to as remote node as soon as it's been fetched from the remote site.
Within this hook implementation, uprpc_import_node_transport_node_prefilter_alter(), we:
- change the node type depending on UI settings
- alter field names according to data obtained from hook_uprpc_import_node_field_mapping() -- the idea being that you write a custom module with that hook and define a mapping.
Further customizations can be done in a custom module, also implementing hook_transport_TYPE_prefilter_alter().
The problem is that it's hard to be sure of whether MYMODULE_transport_node_prefilter_alter() runs before or after uprpc_import_node_transport_node_prefilter_alter(), and hence whether the changes UpRPC makes for you have happened yet or not.
The solution is to have UpRPC invoke its own alter hook, with identical signature, which merely serves to give your module a guaranteed run at the data *after* UpRPC's framework has done built-in data massaging such as node type changes and field mappings.
Comments
Comment #1
joachim commented#1067356 by joachim: Added alter hook at the end of uprpc_import_node_transport_node_prefilter_alter().