diff --git a/plugins/FeedsNodeProcessor.inc b/plugins/FeedsNodeProcessor.inc index 8b7c91e6273348c3cf26770fae0c75cc17a0d5c0..e2fb7ab448d82fc1026581cf1406dbde459ad75f 100644 --- a/plugins/FeedsNodeProcessor.inc +++ b/plugins/FeedsNodeProcessor.inc @@ -231,6 +231,17 @@ class FeedsNodeProcessor extends FeedsProcessor { 'name' => t('Title'), 'description' => t('The title of the node.'), ), + ); + // Include body field only if available. + $type = node_get_types('type', $this->config['content_type']); + if ($type->has_body) { + // Using 'teaser' instead of 'body' forces entire content above the break. + $targets['body'] = array( + 'name' => t('Body'), + 'description' => t('The body of the node. The teaser will be the same as the entire body.'), + ); + } + $targets += array( 'status' => array( 'name' => t('Published status'), 'description' => t('Whether a node is published or not. 1 stands for published, 0 for not published.'), @@ -239,11 +250,6 @@ class FeedsNodeProcessor extends FeedsProcessor { 'name' => t('Published date'), 'description' => t('The UNIX time when a node has been published.'), ), - // Using 'teaser' instead of 'body' forces entire content above the break. - 'body' => array( - 'name' => t('Body'), - 'description' => t('The body of the node. The teaser will be the same as the entire body.'), - ), 'url' => array( 'name' => t('URL'), 'description' => t('The external URL of the node. E. g. the feed item URL in the case of a syndication feed. May be unique.'), @@ -256,6 +262,7 @@ class FeedsNodeProcessor extends FeedsProcessor { ), ); + // Let other modules expose mapping targets. self::loadMappers(); drupal_alter('feeds_node_processor_targets', $targets, $this->config['content_type']);