In order to fix multilingual fields support, the signature for the target preprocess callback was changed. With a preprocess callback you can set or change a mapping option. This is useful if your mapping target supports additional configuration that requires processing. See hook_feeds_processor_targets()
in feeds.api.php for more information about target configuration.
The first two parameters, FeedsSource $source
and $entity
, have been removed. You can no longer use the Feeds source or the entity as context to determine the mapping options. If you need this context, you should process your logic for setting the mapping option in the target callback instead.
Before
/**
* Example of the preprocess_callbacks specified in hook_feeds_processor_targets().
*
* @param FeedsSource $source
* The Feed source.
* @param object $entity
* The entity being processed.
* @param array $target
* The full target definition.
* @param array &$mapping
* The mapping configuration.
*
* @see hook_feeds_processor_targets()
*/
function my_module_preprocess_callback(FeedsSource $source, $entity, array $target, array &$mapping) {
// Add in default values.
$mapping += array('setting_value' => TRUE);
}
After
/**
* Example of the preprocess_callbacks specified in hook_feeds_processor_targets().
*
* @param array $target
* The full target definition.
* @param array &$mapping
* The mapping configuration.
*
* @see hook_feeds_processor_targets()
*/
function my_module_preprocess_callback(array $target, array &$mapping) {
// Add in default values.
$mapping += array('setting_value' => TRUE);
}