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

steven.wichers’s picture

Issue summary: View changes

Removed identifiable information

steven.wichers’s picture

Issue summary: View changes

Specified that only single dates were allowed

twistor’s picture

Component: Feeds Import » Code
Status: Active » Closed (outdated)
Issue tags: -CCK date, -feeds importing, -feeds mapper