Entity Translations and the published status flag
Always nice to start the new year with a challenge.
I created some new products for a client's Drupal Commerce site and translated them into 10 languages. All good until it was noted that the view that displays the products was showing the new products in Dutch not the default English - although all other products were showing up in the correct language.
There didn't appear to be a simple explanation. Caching wasn't the culprit and all looked OK when investigating the new nodes and their translations. Until I noticed that in the translations interface the source translation (English) was set as unpublished.
Aha! I had created the nodes as unpublished in the first instance whilst I preped the translations. But that didn't really make any sense as the nodes are now published and if they weren't they wouldn't appear in the view listing. Intriguing!
So after a lot of head scratching and before doing to much delving around I searched Drupal.org and found this post 'published source node appears as not published in the translate tab' - http://drupal.org/node/1672710 - Thanks Drupal community - saved me loads of time once again!
If you are using Entity Translation then the scenario is caused by creating a node as 'unpublished' in the first instance and then creating translations. Entity Translation sets the status of the translation record to unpublished for the intial node language. When you create some translations, these get set to 'published' and therefore finding no English translation the view gets the first in the list which in my case is Dutch! Disable the Dutch and you get French and so on in Language alphabetical order.
Unfortunately there is no UI for setting the published status of the translation record and updating the node doesn't update the record either (or the issue wouldn't have occurred).
So you have to run the following SQL to see how many are affected:
Check out the discussion in the Entity Translation Issue Queue and follow to keep up dated on how this gets resolved.
*** Update 2013-03-29 ***
Came across this issue again today.
It occurred to me that to be safe you might check the misalignment of the node status vs entity_translation status prior to updating.
- info [at] blue-bag.com
- Telephone: 0843 2894522
- Blue-Bag HQ:
The Garage, Manor Farm
Somerset, BA3 4HP, United Kingdom
- Telephone: (+44) 01761 411542
- Blue-Bag Brighton:
Unit 35 Level 6 North, New England House
New England Street, Brighton
BN1 4GH United Kingdom
- Telephone: (+44) 07944 938204
- VAT GB 748125034
- UK Company Reg: 3932829