Removing the relations module and using entity_dependency would be a great way to cut out some of the burden from this module.
Just need to investigate what sort of info it gives.
http://drupal.org/project/entity_dependency

Comments

danielb’s picture

Hmm that module can tell us what the dependencies are, but it doesn't really give us a way to replace the reference to that entity in our node export in a way that we can find the entity later.

danielb’s picture

I might be able to invoke their hooks to get the info and make some sort of bastardised version of entity_dependency_add() to make the UUID replacement? Not sure.

danielb’s picture

If this works out, for dependencies that are nodes - the node should be (optionally) exported too. But for all entities, the UUID replacement should be made, and matched up on the import.

danielb’s picture

Marking as duplicate #794836: Handle Authors

danielb’s picture

Category: task » feature
Priority: Normal » Major
danielb’s picture

entity_dependency doesn't work quite how I need it to, however it gives me a good idea on how to rewrite node_export_relation to make it easier to implement more relations. Though I might rename it to node_export_dependency.
There will be a generic way to do entity level dependencies and a generic way to do field level dependencies.
The module will still need to be informed via hooks on where to look.
A hook can nominate (perhaps several instances of) a dependent module, a title for settings purposes, the type of dependent entity, and the path of where to look for the id, optionally perhaps callbacks to override the default handling of this.

danielb’s picture

Title: Use entity_dependency? » Improve dependency handling
danielb’s picture

So far I have created a custom version of entity_dependency's code to include in this module. I have also made a request so that entity_dependency can be upgraded to include the flexibility I need and the custom code can be removed in favour of integration with entity_dependency, #1590312: Collect useful data in $dependency property
Now I just need to devise a way to use the data to make the necessary changes to the exports and imports.

danielb’s picture

I have the dependencies exporting now, and I have a good plan on how to handle the imports. Somewhat exciting.

danielb’s picture

Almost done.
It kinda works. Because of #744758: Handle overwriting, skipping, and nid preservation it's hard to test within the same site.

danielb’s picture

Ideally I need to handle books and og.

danielb’s picture

It somewhat handles book and og now, but I suspect more work will be needed during the import to handle these as they are a bit special.
Book issue: #601458: Handle book structure
I'm not an OG user so I don't think I can really do anything about that for now.

danielb’s picture

Status: Active » Fixed

I've committed what I've done for now so hopefully people can start testing it out.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drclaw’s picture

I've been doing some testing with the current development version of Node Export. So far I haven't been able to get the dependencies to import. I just did a simple export with two nodes with one node referencing the other. Also they each had taxonomy term references. On import, however, the taxonomy fields are empty and the node reference auto complete field just has the old nid from the source site and no node title. Anyway, I can elaborate in a new issue, but I thought I'd check to make sure imports are supposed to be working for dependencies before I did that. It seems preemptive to post an issue for something that you know doesn't work yet...

Thanks!

my-family’s picture

Version: 7.x-3.x-dev » 7.x-3.0
Issue summary: View changes

As I can see the dependencies are exported with the right UUIDs but they are not imported