Closed (outdated)
Project:
Feeds
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2012 at 18:24 UTC
Updated:
16 Jun 2016 at 22:07 UTC
Jump to comment: Most recent
CCK date fields will only allow a single start and/or end date set regardless of if the field is set to hold multiple values. The processor does pull the multiple values correctly from the feed (Only XML tested).
<order>
<HDates>2012-01-11</HDates>
<HDates>2012-01-18</HDates>
</order>
The processor will correctly contain the two dates under HDates.
The issue is with the date_feeds_set_target function and the lack of consideration for multiple values.
The following code will remove the :start/:end/date_feeds_set_target functionality as a workaround:
/**
* Implementation of hook_feeds_node_processor_targets_alter().
*
* @see FeedsNodeProcessor::getMappingTargets().
*/
function MYMODULE_feeds_node_processor_targets_alter(&$targets, $content_type) {
foreach ($targets as $key => $info) {
/*
The Feeds default handling of CCK date fields does not play nice when the
field has multiple values. We need to set the functionality to the plain
handler.
*/
if ( 'date_feeds_set_target' == $info['callback'] ) {
list($key) = explode(':', $key);
$targets[ $key ] = $info;
$targets[ $key ]['callback'] = 'content_feeds_set_target';
list($name) = explode(':', $info['name']);
$targets[ $key ]['name'] = $name;
$targets[ $key ]['description'] = t('The date for the @name field.', array('@name' => $name) );
unset( $targets[ $key . ':start' ] );
unset( $targets[ $key . ':end'] );
}
}
}
Comments
Comment #0.0
steven.wichers commentedRemoved identifiable information
Comment #0.1
steven.wichers commentedSpecified that only single dates were allowed
Comment #1
twistor commented