Skip to content
Snippets Groups Projects
Commit a3cfd971 authored by Alex Barth's avatar Alex Barth
Browse files

#622654 hefox: Don't show body as option for mapper when body is disabled.

parent 949ac40c
No related branches found
No related tags found
No related merge requests found
...@@ -231,6 +231,17 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -231,6 +231,17 @@ class FeedsNodeProcessor extends FeedsProcessor {
'name' => t('Title'), 'name' => t('Title'),
'description' => t('The title of the node.'), '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( 'status' => array(
'name' => t('Published status'), 'name' => t('Published status'),
'description' => t('Whether a node is published or not. 1 stands for published, 0 for not published.'), '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 { ...@@ -239,11 +250,6 @@ class FeedsNodeProcessor extends FeedsProcessor {
'name' => t('Published date'), 'name' => t('Published date'),
'description' => t('The UNIX time when a node has been published.'), '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( 'url' => array(
'name' => t('URL'), '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.'), '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 { ...@@ -256,6 +262,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
), ),
); );
// Let other modules expose mapping targets.
self::loadMappers(); self::loadMappers();
drupal_alter('feeds_node_processor_targets', $targets, $this->config['content_type']); drupal_alter('feeds_node_processor_targets', $targets, $this->config['content_type']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment