1

I have created a Feed Importer and used XPath Parser for mapping. I have problem with updating a existing content. For example I have this xml structure.

<node>
  <nid>1</nid>
  <title>Title 1</title>
</node>
<node>
  <nid>2</nid>
  <title>Title 2</title>
</node>

I started importer and everything is OK. I set NID as unique and check "Update existing content" in Node Process settings. So when I run importer again whit the same data this nodes have updated again.

Why have been updated ? The source is the same and don't any difference. Should It display, there is no new content to add if I start importer again and again with the same data ?

Thank you!

1 Answer 1

1

it doesn't recognized the nid field as unique,

What is the field associated with the nid value?

If you have a custom field associated with the nid :

You should install https://www.drupal.org/project/field_validation

and add the validation of the field at http://yourwebsite/admin/structure/field_validation

and set the validator with the value "Unique values".

Sometimes a space in the value of the feed can cause this in this case you can use tamper for trim spaces : https://www.drupal.org/project/feeds_tamper

7
  • So this nid from srouce does not relation with Drupal. This is id from another system and I just use it for GUID and set as unique. I will try with feeds tamper first trim the value and second set unique for it. Sep 29, 2015 at 5:10
  • No it does not work. Create tamper for GUID (set trim and unique tamper). But every time when I run import the nodes are updating. Some times does not update. So if I run 5 times 4 of them will be updated 1 does not. This is so strange. Sep 29, 2015 at 9:19
  • What kind of field is GUID? text, number, others...? Sep 29, 2015 at 9:55
  • GUID is a number. <event id="27731">...</event>. This is my real data and I get @id for GUID. Sep 29, 2015 at 12:53
  • and what is it the type of field in your content type ( where do you store the id number) is text, integer, Long text? Sep 29, 2015 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.