Hello,
after changing Title to field I'm not able anymore unpublish translated version of the node.
I was able to reproduce it very quickly on clean installation on simplytest.me
clean install of Drupal 7.24 + Entity Translation 7.x-1.0-beta3
enabled Czech Language; order English,Czech; Detection method URL
Content Type Basic page: enabled Multilingual support - enabled, with field translation
Field Body - Translation Enabled
new node - with body in English
translation of this node to Czech - Czech content
both pages are visible to anonymous users node/1 (English Content) and cs/node/1 (Czech Content)
for Czech version - unchecked "This translation is published", save
anonymous user see node/1 (English Content) and cs/node/1 again English Content - good!
for Basic page enable Title as field
anonymous user see node/1 (English Content) and cs/node/1 Czech Content - bad!!! For Czech it still unchecked "This translation is published"
Thanks
Comment | File | Size | Author |
---|---|---|---|
#6 | title-et.png | 18.59 KB | Bohus Ulrych |
Comments
Comment #1
plachThanks for the detailed report, but can you please repeat the test with the latest dev versions of both ET and Title?
Comment #2
Bohus UlrychThanks for reply.
I can confirm same behavior with latest devel versions (drupal-7.24):
entity_translation-7.x-1.x-dev 2013-Oct-25
title-7.x-1.x-dev 2013-Oct-27
P.S. Tested on local virtual machine because I don't know how to install devel versions of modules on simplytest.me
Comment #3
plachOk, thanks.
Comment #4
FiNeX CreditAttribution: FiNeX commentedI confirm this bug using:
Comment #5
Bohus UlrychStill not working
Update:
it seems that now it is working well
Drupal 7.31
Entity Translation 7.x-1.0-beta3+11-dev 2014-Jan-22
Title 7.x-1.0-alpha7 2013-Mar-18
Comment #6
Bohus UlrychThis bug still remains.
Tested with latest versions:
Drupal 7.31
Entity Translation 7.x-1.0-beta3+11-dev 2014-Jan-22
Title 7.x-1.0-alpha7 2013-Mar-18 (and also 7.x-1.x-dev tar.gz 2014-Jun-13)
I think that problem is in the function title_field_sync_get() on this line
$langcode = field_language($entity_type, $entity, $info['field']['field_name'], $langcode);
In this function field_language() from the file field.multilingual.inc is called
drupal_alter('field_language', $display_language, $context);
And in the entity_translation.module there is function entity_translation_field_language_alter() which doesn't get full $entity object.
I solved this by replacing
$langcode = field_language($entity_type, $entity, $info['field']['field_name'], $langcode);
with
if ($langcode === NULL) {
$langcode = field_language($entity_type, $entity, $info['field']['field_name'], $langcode);
}
and it seems to be working.
Maybe it can be replaced with
$langcode = title_entity_language($entity_type, $entity);
but this will replace also menu items ... with the original language. And I prefer to have this translated.
Comment #7
plachThis looks like a duplicate of #1762064: Unpublished translations are visible to non-administrators. Patch over there, please let me know how it works.
Comment #8
plachComment #9
Bohus UlrychHello,
patch mentioned here #1762064 didn't helped. But in that ticket is mentioned #2085457: Wrong cache is initialized in field_language() and patch title-wrong_cache_in_field_language-2085457-1.patch works well with Title 7.x-1.0-alpha7 / 2013-Mar-18.
But as noticed in #2085457 all this has been fixed in the latest dev version.
Feature "This translation is published" works well with Title 7.x-1.x-dev / 2015-Mar-23 (no patching needed).
Thank you for help!