In _feeds_nodeapi_node_processor of feeds.module .

    case 'update':
      if (isset($node->feeds_node_item)) {
        $node->feeds_node_item->nid = $node->nid;
        drupal_write_record('feeds_node_item', $node->feeds_node_item, 'nid');
      }
      break;

After I have removed the 'nid' from the 4th line of the code, then the save function start to work.

drupal_write_record('feeds_node_item', $node->feeds_node_item); 

Comments

wqmeng’s picture

Ok, After review the code, I have found that on my site, to avoid the feeds module to create duplicate node of the exist node which have submited by the author manually I need a check to know if the nid already in the feeds_node_item table.

I have changed the code to the new one.

    case 'update':
      if (isset($node->feeds_node_item)) {
        $node->feeds_node_item->nid = $node->nid;
        $nid = db_result(db_query('SELECT nid FROM {feeds_node_item} WHERE nid = %d', $node->nid));
        if ($nid){
          drupal_write_record('feeds_node_item', $node->feeds_node_item, 'nid');
        }else{
          drupal_write_record('feeds_node_item', $node->feeds_node_item);
        }
      }
      break;
alex_b’s picture

Status: Active » Postponed (maintainer needs more info)

Can you give more context of how this error occurs? In what succession did you add feeds/remove feeds/refresh them?

What you describe looks *highly* irregular. #2 can't be a good fix, there must be a problem somewhere else.

alex_b’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing due to inactivity.