I've got a content type called 2Wd-Tractor with this structure :
- Model (node title)
- Engine
- Transmission
- Operational
- Hydraulic System
Engine field is a custom field implemented using Field Api and it does have these subfields :
- Make
- Model
- Net Power
- PTO Power
- Aspiration
- Power Measured At
- and ...
After that to make this field visible in feeds mapping hook_feeds_processor_targets_alter was implemented.
Here is the code :
foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance)
{
$info = field_info_field($name);
unset($callback);
if ($info['type']=='uceen2wdtractor')
{
//The callback for this field type goes here.
$callback = 'TARGET_SETTER_FOR_en2wdtractor';
}
if (isset($callback))
{
$targets[$name] =array(
'name'=>check_plain($instance['label']),
'callback' => $callback,
'description' => t('The @label field of the node.', array('@label' => $instance['label'])),
);
}
}
Data is imported to Feeds using json files , An importer is provided with these settings :
finally this is my json file :
The Problem is no data is stored in Engine field . this is the dsm($node) in hook_node_presave :