When exporting a node together with it's translations, the translated nodes are exported as empty nodes. I'm using the i18n module which rewrites the "get node by uuid" query in uuid.module to filter out non-default language nodes.

I have a patch that turns off i18n rewriting using i18n_selection_mode('off').

Comments

chaps2’s picture

StatusFileSize
new1.52 KB

Patch attached.

chaps2’s picture

Thinking about this some more, I wonder whether it would be better to add another content selection type for nodes with translations. At the moment the content type displays all nodes including translations. It would be better perhaps if the content selection only displayed default language nodes and exported the node translations automatically.

Just a thought.

chaps2’s picture

Title: With i18n installed, only exports nodes that have default language or are language neutral » Export node translations
Category: bug » feature
Status: Active » Needs review
StatusFileSize
new4.38 KB

...and that thought turned into another patch.

This one restricts the content selection to nodes either with no translation or that are the "source" node for other translations.

If other languages are enabled then selected nodes will have any existent translation nodes for all enabled languages exported with them.

This patch depends on the one I've just posted here: #1049760: New hook invoked after all nodes have been rebuilt.

As always comments and feedback very welcome...

ryan_courtnage’s picture

Attached is reroll in 2 flavours - one with the dependancy of #1049760 included in the diff. One without (so apply patch for #1049760 after applying this one)

ryan_courtnage’s picture

The patch including #1049760 had a bug. Attached is fixed version.

dsnopek’s picture

Status: Needs review » Needs work

Shouldn't this patch call i18n_selection_mode('reset') after it's finished to clean up?

Personally, I don't think node_get_by_uuid() should be calling db_rewrite_sql() at all: #1261196: node_get_by_uuid should not pass query through db_rewrite_sql