Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
danielb CreditAttribution: danielb commentedHmm 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.
Comment #2
danielb CreditAttribution: danielb commentedI 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.
Comment #3
danielb CreditAttribution: danielb commentedIf 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.
Comment #4
danielb CreditAttribution: danielb commentedMarking as duplicate #794836: Handle Authors
Comment #5
danielb CreditAttribution: danielb commentedComment #6
danielb CreditAttribution: danielb commentedentity_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.
Comment #7
danielb CreditAttribution: danielb commentedComment #8
danielb CreditAttribution: danielb commentedSo 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.
Comment #9
danielb CreditAttribution: danielb commentedI have the dependencies exporting now, and I have a good plan on how to handle the imports. Somewhat exciting.
Comment #10
danielb CreditAttribution: danielb commentedAlmost done.
It kinda works. Because of #744758: Handle overwriting, skipping, and nid preservation it's hard to test within the same site.
Comment #11
danielb CreditAttribution: danielb commentedIdeally I need to handle books and og.
Comment #12
danielb CreditAttribution: danielb commentedIt 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.
Comment #13
danielb CreditAttribution: danielb commentedI've committed what I've done for now so hopefully people can start testing it out.
Comment #15
drclaw CreditAttribution: drclaw commentedI'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!
Comment #16
my-family CreditAttribution: my-family commentedAs I can see the dependencies are exported with the right UUIDs but they are not imported