2

I have a scenario like this:

I am using Feeds Importer to import one content type data. I am using GUID field as the unique field. Also, I am exporting these all the nodes of this content type using Views into a .csv file.

My problem is that users can create nodes using the Feeds Importer and also manually in the Drupal admin console.

While I export the nodes of the content type, it contains all nodes (manually created nodes and Feeds imported nodes). There will be no GUID for the manually created nodes.

In this case, how can I resolve the issue of re-import of this data into the Drupal tool?

Is there a way to update the GUID field in the database whenever a new node of this type is created? This will resolve the issue.

1 Answer 1

0

Install Universally Unique IDentifier and use it as GUID.it is not required you create GUID field in most of time Nid is good choice as GUID mapper.

Universally Unique IDentifier Description :

This module provides an API for adding universally unique identifiers (UUID) to Drupal objects, most notably entities. Features in Drupal 7 version Automatic UUID generation

UUIDs will be generated for all core entities. An API is provided for other modules to enable support for custom entities. UUID API for entities, properties and fields

With this unified API you can load entities with entity_uuid_load() so that all supported properties and fields are made with UUID references. You can also save entities formatted this way with entity_uuid_save() (depends on Entity API). Export entities to use as default/demo content

The integration with Features module provides the ability to export UUID enabled entities with intact dependencies and references to other entities. This functionality depends on Deploy module 7.x-2.0-alpha1 (soon to be released) and is probably the most robust way for installation profiles and distributions to provide demo content!

7
  • In that case, if user adds new rows into the excel file and if the user uploads the file, how will the UUID gets updated for the newly created nodes?
    – Kiran
    Commented May 16, 2016 at 12:23
  • Apologize me, what you want to do? first import data form csv to site, then again export them, add some row to data and again import it to site?
    – Yuseferi
    Commented May 16, 2016 at 12:24
  • Yes. This is my requirement.
    – Kiran
    Commented May 16, 2016 at 12:29
  • @Kiran why don't try incremental method? just add new items to file and import them, why you export old ones?
    – Yuseferi
    Commented May 16, 2016 at 12:30
  • @Kiran Do you have custom module ?
    – Yuseferi
    Commented May 16, 2016 at 12:32

Your Answer

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

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