Skip to content

Instantly share code, notes, and snippets.

@iAugur
Last active December 15, 2015 13:48
Show Gist options
  • Select an option

  • Save iAugur/5269584 to your computer and use it in GitHub Desktop.

Select an option

Save iAugur/5269584 to your computer and use it in GitHub Desktop.
The entity_translation status does not get updated when the node status changes - This can lead to the main language translation not appearing - see http://technology.blue-bag.com/entity-translations-and-published-status-flag
/**
* Get a list of nodes where the entity_translation status is not in sync
* Note we only get the unpublished translations as it is the node status we are concerned with
* We are also only interested in the source translations
**/
select node.status, et.status
from entity_translation et
inner join .node on node.nid = et.entity_id and et.entity_type = 'node'
where node.status <> et.status and et.status = 0 and et.source = ''
/**
* Update Entity_translations for node status
* Only update the source records and then only those that are unpublished
**/
UPDATE entity_translation et
inner join node n on n.nid = et.entity_id and et.entity_type = 'node'
SET et.status= 1
where n.status <> et.status and et.status = 0 and et.source = '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment