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.
Here is a simple patch that will allow other modules to alter the exported content. I'm not sure if this is something other people would like to see but I've personally found this kind of functionality to be really useful.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1754428-allow-node-export-alter.patch | 608 bytes | pirog |
Comments
Comment #1
pirog CreditAttribution: pirog commentedComment #2
populist CreditAttribution: populist commentedWhat kinds of use cases would this kind of alter hook be useful in solving?
Comment #3
pirog CreditAttribution: pirog commentedi think there are a couple of tracks
1. if you wanted to provide a "content skeleton" that a site builder or end user could then modify and you didn't want these changes to make the feature show up as overridden.
2. if you have any sort of site specific ID reference, such as taxonomy terms on a node it would be good to exclude them from the export since they are likely not going to match up on different sites.
Comment #4
pirog CreditAttribution: pirog commentedi look at #2 as something that eventually would be replaced with better support for handling referenced entities via UUID or something similar.
Comment #5
populist CreditAttribution: populist commentedHere are some cleaner use cases:
1.) You want to modify your default content by adding information (i.e. taxonomy terms) as part of installation but you don't want those to be exported again
2.) You want to use the UUID module for your site, but don't want to export that out to your feature
3.) You want to automatically update the created/modified times each time the item is exported.
Comment #6
populist CreditAttribution: populist commentedI also went ahead and tested this out and it works great. Shouldn't be a problem rolling it in since it only is used if someone explicitly invokes the alter hook.
Comment #7
Jeffrey C. CreditAttribution: Jeffrey C. commentedAll right. I'll commit it ASAP. Meanwhile, please take a minute to check out #1869366: Future Plan.
Comment #8
Jeffrey C. CreditAttribution: Jeffrey C. commentedAdding the tag.