Closed (fixed)
Project:
Feeds
Version:
7.x-2.0-alpha5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Jul 2012 at 19:59 UTC
Updated:
12 Jun 2016 at 12:34 UTC
Jump to comment: Most recent
Comments
Comment #1
edev commentedComment #2
megachrizIf you attach your importer to a content type and use 'GUID' as your unique target, users will need to create a node to import content. Since the GUID is restricted to content imported using the created feed node, users will not be able to import eachothers content.
Using GUID as unique target has one limitation: you can only update content imported by Feeds. If you want your users also be able to update manually created content, you need to have something else as unique target. Since Feeds 7.x-2.0-beta1 other fields can be marked as unique target when using "Unique values" validation rule from the Field validation module. As this solution alone doesn't help to prevent users from overwriting eachothers content, you will also need to use the "Rewrite" plugin from Feeds Tamper to add in the unique user value:
[parent:uid]_[id].This way the unique value is a combination of the user ID and the unique ID from the source file, preventing an user from updating content created by other users. You will need to write additional code though to fill in the unique text field with the right value when the user manually creates the content. And you will need to prevent the users from being able to edit the text field. This can be done with the Field permissions module for example.
You can also implement your own custom solution for retrieving existing nodes using "unique callbacks". See https://www.drupal.org/node/1307732#field_as_unique_id_7 for more information.