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.

CommentFileSizeAuthor
#1 1754428-allow-node-export-alter.patch608 bytespirog
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pirog’s picture

Status: Active » Needs review
FileSize
608 bytes
populist’s picture

What kinds of use cases would this kind of alter hook be useful in solving?

pirog’s picture

i 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.

pirog’s picture

i look at #2 as something that eventually would be replaced with better support for handling referenced entities via UUID or something similar.

populist’s picture

Here 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.

populist’s picture

Status: Needs review » Reviewed & tested by the community

I 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.

Jeffrey C.’s picture

All right. I'll commit it ASAP. Meanwhile, please take a minute to check out #1869366: Future Plan.

Jeffrey C.’s picture

Issue tags: +7.x-1.0-alpha8 blocker

Adding the tag.