When we create first translation of some node (when origin node already exists), in hook translation_node_insert() we directly update in table tnid value of origin node.


But, if origin node within same request is used in some way, tnid will be missed, and if you save that node, tnid will be overridden with empty value.


It's not evident to use fresh copy of node everywhere, that's why i propose to assign tnid value to node, to have it in all static storages:
$node->translation_source->tnid = $tnid;

See attached patch for correction.

Comments

IRuslan’s picture

Issue summary: View changes
IRuslan’s picture

Issue summary: View changes
IRuslan’s picture

StatusFileSize
new714 bytes

I found some disadvantages of such patch and improve it with new.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.