I'm using a csv file to import feeds, using the feed node processor. I can successfully import new feed nodes when the option for "Replace existing feed nodes" is unset. However, without this option I'm unable to update existing feed nodes.

But when the option "Replace existing feed nodes" is set, no matter what changes have been made to the contents of the csv file (to either update existing feeds or add new feeds), I keep getting the response "There is no new content."

There are previous issues related to this "There is no new content." message but those are about line format endings which this isn't about, because I can get the feeds created when "Replace existing feed nodes" is unset.

So, is this a bug, anyone else experience the same?
Can anyone help?

cheers
scotjam

Comments

scotjam’s picture

Can anyone help here?

Any ideas why when using the option "Replace existing feed nodes", I keep getting "There is no new content."?

I can add new feed nodes, but I can't update them.

cheers
scotjam

scotjam’s picture

Title: "Replace existing feed nodes" » "Replace existing feed nodes" - how to get this option working?
scotjam’s picture

Category: bug » support
nicolash’s picture

Have you tried this with other CSV files? Maybe use one of the ones in the feeds/tests/feeds folder to see whether it has anything to do with the particular file you are trying to import.

scotjam’s picture

The test which I've done is to use the same csv file with and without the 'Replace existing feed nodes' option set.

Without the option set, I'm able to import the feeds, but with the option set, the batch runs as you'd expect but the response is 'There is no new content'.

So, from that I taken it that the csv file is fine.

Is this a bug then?

imclean’s picture

Just to check the obvious, have you set a "unique target" on the mappings screen?

scotjam’s picture

...checked. 'unique target' is set.

Next, I've just installed drupal using the feeds profile, created a feed node importer, and set the options as I normally would. But still no joy! I've attached the export of the test feed node importer, and a test csv file with dummy data.

$feeds_importer = new stdClass;
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'test_feed_node_importer_updates';
$feeds_importer->config = array(
  'name' => 'test feed node importer updates',
  'description' => '',
  'fetcher' => array(
    'plugin_key' => 'FeedsFileFetcher',
    'config' => array(
      'direct' => FALSE,
    ),
  ),
  'parser' => array(
    'plugin_key' => 'FeedsCSVParser',
    'config' => array(
      'delimiter' => ',',
    ),
  ),
  'processor' => array(
    'plugin_key' => 'FeedsFeedNodeProcessor',
    'config' => array(
      'content_type' => 'feed',
      'update_existing' => 1,
      'mappings' => array(
        0 => array(
          'source' => 'json_feed',
          'target' => 'source',
          'unique' => 1,
        ),
        1 => array(
          'source' => 'title',
          'target' => 'title',
          'unique' => FALSE,
        ),
      ),
    ),
  ),
  'content_type' => '',
  'update' => 0,
  'import_period' => 1800,
  'expire_period' => 3600,
  'import_on_create' => TRUE,
);
title,json_feed
1,http://www.example.com
2,www.example.com
3,http://www.example.com/test.txt

I must be doing something really silly here, but I can't tell what!

k3n3dy’s picture

Subscribing

jgreidy’s picture

Nice to know that it's possible to get Feed Node Processor to work with CSV files at all. The 'unique target' switch works with OPML files.

scotjam’s picture

Category: support » bug

So, its a bug then. Hope to be proved wrong :)

Bug is, CSV files don't work when using Feed Node Processor with 'unique target' set.

lookatthosemoose’s picture

subscribe....

__Sander__’s picture

It's a bug.
Look at this line:
if (!$nid = $this->existingItemId($batch, $source) || $this->config['update_existing']) {
replace it with
if ((!$nid = $this->existingItemId($batch, $source)) || $this->config['update_existing']) {
instead

It's the priority of operators. In the existing form (without brackets) it first does || and then !

__Sander__’s picture

However it still does not work properly after fixing and recreates duplicates

__Sander__’s picture

False alert. Works ok. I forgot about unique targets

Kman2123’s picture

This is not working for me either. I am getting same message but running 6.x-1.x-beta10

Kman2123’s picture

I updated to the latest dev version that was posted on 6/22 and that fixed the issue.

twistor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)