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

CommentFileSizeAuthor
#6 title-et.png18.59 KBBohus Ulrych
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for the detailed report, but can you please repeat the test with the latest dev versions of both ET and Title?

Bohus Ulrych’s picture

Thanks 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

plach’s picture

Version: 7.x-1.0-alpha7 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

Ok, thanks.

FiNeX’s picture

I confirm this bug using:

  • Drupal 7.26
  • Entity Translation 7.x-1.0-beta3+11-dev 2014-01-22
  • Title 7.x-1.0-alpha7+8-dev 2014-01-22
Bohus Ulrych’s picture

Still 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

Bohus Ulrych’s picture

FileSize
18.59 KB

This 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.

plach’s picture

Status: Active » Closed (duplicate)

This looks like a duplicate of #1762064: Unpublished translations are visible to non-administrators. Patch over there, please let me know how it works.

plach’s picture

Bohus Ulrych’s picture

Hello,
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!