Feedapi node module do not respect body node settings. I.e. when there is no bidy in content, feedapi node still create body content if there is description field available in the feed.

Simple fix - change (around line# 300):

  $node->body = $feed_item->description;
  $node->format = isset($settings['input_format']) ? $settings['input_format'] : FILTER_FORMAT_DEFAULT;
  $node->teaser = node_teaser($feed_item->description);

to:

  if ( db_result(db_query("SELECT has_body FROM {node_type} WHERE type='%s'", $node->type)) == 1 ) {
    $node->body = $feed_item->description;
    $node->teaser = node_teaser($feed_item->description);
  }
  $node->format = isset($settings['input_format']) ? $settings['input_format'] : FILTER_FORMAT_DEFAULT;

Unified patch attached

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aron Novak’s picture

Version: 6.x-1.7-beta1 » 6.x-1.x-dev
Status: Active » Needs review
FileSize
1.04 KB

I like the idea, because you can really disable body field, however the solution is suboptimal.
Can you confirm that the patch that I attached just does what you want?

Aron Novak’s picture

Status: Needs review » Fixed

Tested, seems to be fine. Committed.
http://drupal.org/cvs?commit=227168

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

smartinm’s picture

Status: Closed (fixed) » Needs review
FileSize
1023 bytes

I think node teaser should not be set if body field is disabled. This is the behavior of Drupal on node_submit():

  // Generate the teaser, but only if it hasn't been set (e.g. by a
  // module-provided 'teaser' form item).
  if (!isset($node->teaser)) {
    if (isset($node->body)) {
      $node->teaser = node_teaser($node->body, isset($node->format) ? $node->format : NULL);
    }
    else {
      $node->teaser = '';
      $node->format = 0;
    }
  } 

Simple patch attached.

Aron Novak’s picture

Status: Needs review » Fixed

Thank you, committed, makes sense.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.