hello

here is the situation
i have one website with drupal installation with several modules. among those, i have the entity translation module with a fallback settings.

here is my settings :
configuration > regional > languages : english is set as default language
configuration > regional > languages > configure : language detection is through URL only
configuration > regional > entity_translation : enable language fallback = yes
configuration > regional > i18n > select : select nodes by language = no

here is what i expect :
INPUT : my content is in english. it happens, my content can be translated in french
OUTPUT : all contents should be displayed in english language

here is what i get :
i have different cases which displays on my site :
- content in english, no translation available : default display is in english : this is what i expect
- content in english, french translation available : default display is in english : this is what i expect
- content in english, french translation available : default display is in french : this is _NOT_ what i expect.

how to reproduce :
method A -> this method reproduce the issue
- add new content.
- save it as draft : language is still neutral and it is not published yet (uncheck the published checkbox)
-> the content does not appear on the site
-> there's no translate tab at this step
- edit it again.
- "finalize" the node. change the language to english and check the publish checkbox.
- save it.
-> there's a translate tab
-> the english content appears on the site
- edit the translate tab list
-> the source node is "not published" while the other language is "not translated"
- translate the node and publish it
-> the source node is "not published", the translated node is "published"
-> the translated content appears on the site and the english content no more.

method B -> this method reproduce the issue
- add new content
- save it as draft : language is already english and it is not published yet (uncheck the published checkbox)
-> the english content does not appear on the site
-> there's no translate tab at this step
- edit it again.
- "finalize" the node. check the publish checkbox.
- save it.
-> there's a translate tab
-> the english content appears on the site
- edit the translate tab list
-> the source node is "not published" while the other language is "not translated"
- translate the node and publish it
-> the source node is "not published", the translated node is "published"
-> the translated content appears on the site and the english content no more.

method C : this is a workaround and it avoids the issue
- add new content
- save it as finalized : language is already english and it is published
-> the english content appears on the site
-> there's no translate tab at this step
- edit it again.
-> there's a translate tab
- edit the translation tab list
-> the source node is "published" while the other language is "not translated"
- translate the node and publish it
-> the source node is "published", the translated node is "published"
-> the source content (english) appears on the site

NOTE : with method C, when unpublishing the source node, the source node _AND_ its translation are unpublished.

As I see it, this last behaviour might mean that the publication status in the translate tab are linked to the "readiness" of the translated entity fieds. But it is not linked to the node publication status. Since this is not possible to "unready" the original content, maybe this status should be always "Published" for the original content.
Then
- when the translation list is generated, the original content translation status is published
- we can control the publication of each translation since the translation edition screen allow us to publish or unpublish the translation
- we can control the whole node publication status with the edit tab publishing options menu.

By the way, now, i have the collateral synchronizing issue : how to "ready" my published-node-but-not-published-original-content-status ?

Comments

jaialin’s picture

Me too. I don't have access to our organization's SQL tables, but my guess is that the "published" flag gets frozen if the source material isn't published before the translation module is invoked. I'm going to try and ninja the tables to see if I can clear it up... wish me luck.

plach’s picture

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

Please, try with the latest dev and see if the problem is still there.

valencianok’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha2
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.08 KB

Happened to me too.

This is what I did:

  1. Create a content (Spanish) with "No published" status
  2. Then create a translation (English) and mark it as "published"
  3. Then edit the original content (Spanish) and mark it "published"

Led me to: The original language translation still marked as "Not published", despite of the node status of published, because each translation has its own status, but could not get it updated on the regular node edit page; so I was always seeing the published translation (English) despite the language.

Because of post #2, I downloaded the latest dev version on my dev site, and this problem got solved by unifying the edit form, so each translation can update its own translation settings, but this dev version didn't handle translations body and summary well, so rolled back...

So what I did was a little patch to the entity_translation_overview page, to always get the "edit translation" link to be able to acces the translation settings form, and skipped the edit button because it is already on the tabs for the node.

Status: Needs review » Needs work

The last submitted patch, entity_translation.admin_.inc--translation-status-problem.patch, failed testing.

plach’s picture

Status: Needs work » Postponed (maintainer needs more info)

Before submitting a patch, please check the latest dev.

haclong99’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev

Hello

I have installed the dev version.

Here's my test :

My entity translation settings is :
Enable language fallback = Y
Display shared labels = Y
Translatable entity types = Nodes (only)

Other settings remain unchanged

Add a new content, language english, as a draft = not published yet.
Save
-> the translate tab appears.
-> the english version (in the translate tab) is "not published" status
-> WRONG : the body of my node (in the node page) lost all its settings (meaning : return carriage)

Edit the unpublished node
Publish it
Save
Go to page
-> the summary (different from the body) looks fine
-> WRONG : the body of the node still lost its settings while in edit mode, all the return carriage are fine
-> the english version (in the translate tab) is "published" status now

Add a french translation. This one is published.
Save
-> WRONG : the title of the node (which were translated) is not on the node page
-> WRONG : the body of the node does not include carriage return and the HTML (<b>) tags is not working while i was editing with filtered HTML filter

Checking the english version now
-> WRONG : the body of the node which should be english is french now (still no carriage return)

Checking the nodes from page
-> WRONG : the node's title is always english. No matter which language we are viewing.
-> WRONG : the summary is always french. No matter which language we are viewing
-> WRONG : tags are always french, no matter which language we are viewing
-> the summary carriage return are ok

Editing the english version
-> WRONG : the tag field english content was replaced by the french content
-> WRONG : the summary field english content was replaced by the french content
-> WRONG : the body field english content was replaced by the french content

Editing the french version
-> WRONG : the title field french content is empty now
-> WRONG : the summary field french content is empty now
-> WRONG : the body field french content is empty now
-> WRONG : url alias seems to link to the english title

I haven't checked further features
-> shared image field
-> shared book field
-> comments
-> wysiwyg functionnalities

I believe the current -dev version is not ok yet.

Maksym Kozub’s picture

I seem to have the same issue with 1.0-alpha2. I also have another issue, which may be related to this one — plach, please tell me whether I should open a separate issue. I have a content type with translation (Enabled, with field translation" (i.e. translatable through ET). I created a language-neutral node of that type, and later realized that I need it in several language versions. I changed its language from "Language neutral" to "English". As soon as I do that, I get the translation form, but the original English version is always marked as "Not published" in the translations table (even though it is "Published" in the editing form, as well as in the list of content. When I try to open in as a non-admin user, I get "English translation unavailable for ... (name of the node in question here)".
If I change it back to "Language neutral", I see it again in the English version of the site. Funnily enough, even though there is no Translate tab nor the translations list anymore, I still see the (previously published) translations in the respective language versions of the site. I.e., I see my "language-neutral" original text in the English version of the site, but, say, the Russian translation (which cannot be unpublished, deleted etc. anymore) in the Russian version.
I cannot try the -dev version at the moment. (As far as I understand, it needs the -dev version of the core, and I am lacking the development environment now to install Drupal 7-dev core.)

stevieb’s picture

this seems to be fixed with the latest dev release 7.x-1.0-alpha2+97-dev

plach’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok, thanks. Feel free to reopen if needed.

Maksym Kozub’s picture

Status: Fixed » Postponed (maintainer needs more info)

@stevieb: thank you, I have updated the module to the latest -dev, and I will check later how this latest version handles that situation.

jpatriciogs-1’s picture

I have the same issue using v1.0-alpha2 : source node keeps hidden (for non-admins) while everything else is published

Workaround: use your SQL ninja skills
A) phpMyAdmin inline edit select your DB then the 'entity_translation' table then update the status flag for the original node or ...
B) UPDATE `entity_translation` SET `status` = '1' WHERE `entity_translation`.`entity_type` = 'node' AND `entity_translation`.`entity_id` = $FAIL_NODE$

It solves the problem

haclong99’s picture

I haven't tried the last dev version.
But I use the scheduler module.
Here's the steps with the scheduler :
1/ create a new node
2/ choose the source language (english)
3/ schedule for a forecoming date (next week for example)
4/ publish
5/ save source node (english - published - scheduled)
6/ edit and add french translation
7/ save french translation (french - published - scheduled)

When the node is finally published, the french translation status is "Published" when the source node status still is "not published"...

There may be an compatibility issue here.

haclong99’s picture

I've just done my first test case for the Entity_Translation.7.x-0.0-alpha2+97-dev
Here's my tests :

My entity translation settings is :
Enable language fallback = Y
Display shared labels = Y
Translatable entity types = Nodes (only)

Other settings remain unchanged

CASE A :
- Add a new content (language neutral - published)
- Save it
- Edit content
- Assign english language
- Save it
- Translate to french (published)
- Save it

Case B :
- Add a new content (language english - published)
- Save it
- Translate to french (published)
- Save it

Case C
- Add a new content (language english - not published)
- Save it
- Edit content (published)
- Save it
- Translate to french (published)
- Save it

Case A, B and C, english version (before publication of french translation) - view mode
- Body presentation (return carriage) disappears at view mode.

Case A, B and C, english version (after publication of french translation) - view mode
- Total disappearance of the english version. The english node is still published and we can access it but the english body is replaced by the french body

Case A, B and C, french version - view mode
- Title are not translated. The sole english title is published.

Case A both version
After several attempts to retrieve my english body content, I end up with an empty body field... Now the case A does have no more body text in both version

Checking the nodes from page
-> WRONG : the node's title is always english. No matter which language we are viewing.
-> WRONG : the body is always french. No matter which language we are viewing

Editing the english version
-> WRONG : the body field english content was replaced by the french content

Editing the french version
-> WRONG : the title field french content is empty now
-> WRONG : the body field french content is empty now
-> WRONG : url alias seems to link to the english title

I haven't checked further features
-> shared image field
-> shared book field
-> comments
-> wysiwyg functionnalities
-> scheduler functionnalities

I believe the current -dev (97) version is not ok yet.

GN’s picture

I cannot recall where I found it, but for older versions of ET the "published source node appears as not published in the translate tab" bug could be fixed by adding to entity_translation.node.inc

/**
 * Update translation status of the source translation when changing the status
 * of the node.
 */
function entity_translation_node_update($node) {
  db_update('entity_translation')
    ->fields(array('status' => $node->status))
    ->condition('entity_id', $node->nid)
    ->condition('source', '')
    ->execute();
}  

The latest version (ET 7.x-1.0-alpha2+97-dev) seems to cope with the published source node status problem even without this (though the translation status (published/unpublished) does not actually control its visibility - see #1762064: Unpublished translations are visible to non-administrators).

davemybes’s picture

Testing 7.x-1.0-alpha2+97-dev gives me weird results with several things. For a node that was neutral, English was selected and greyed out when I editing the node to switch language. Possibly not a big deal, but I couldn't select another language. Saving it without doing anything switches it to English. Now the Edit tab is gone. Translate tab is there, and the English version is still Published. So that's good. Now if I click "Add" next to a language, I get a node form, with English selected and not changeable. All the fields are also empty. Also not so useful. Lastly, if I go to the node edit page directly, I see my user profile page instead of the node form. The page I see could be specific to my setup, but not getting the edit form is not so good. So this dev version is pretty broken imo, and for now I'll just edit the db directly to fix the unpublished English translation.

*update*: After experiencing that weirdness, I reverted the module back to alpha2 and things worked properly as before. The English node was still published, so that was good, but if I repeat the steps with another node, it will be unpublished.

miro_dietiker’s picture

Status: Postponed (maintainer needs more info) » Fixed

We have the same issue with alpha2.
But -dev seems broken. No page delivery anymore, watchdog contains tons of "PHP undefined index" from entity_translation module...
Don't know the exact source of the issues, but it's dead.

Hope -dev will be stable soon...

plach’s picture

@miro_dietiker:

It's pretty weird what you are reporting, dev should be pretty stable right now. In fact there will be a beta out soon, based on it. Maybe one of the latest commits broke something? Can you track the origin of the errors?

plach’s picture

Also, why has this been marked fixed?

miro_dietiker’s picture

Priority: Normal » Major
Status: Fixed » Active

Accidentally switched..

Rechecked with -dev. Same situation here.
Also i ran into an issue that system is fully broken. The menu alter clearly has a weight problem it seems.

Still published doesn't switch with publishing the main (entity translation enabled node) entity when a translation is already there.
The node (source english) switches to published while the translation record (of the source language) is still unpublished.

Tried it with a fresh install. Same problem.
New drupal, dl entity entity_translation-7.x-1.x-dev
New content type "test" with entity translation and body translateable.
Unpublished new content - add translation, published - edit main node, publish node
Result: translation of source language in translate tab still is in unpublished state.

EDIT: My previous reported unstability seems in addition to be this: #1818440: Fatal error with unclean edit path

plach’s picture

Well, if I understand this issue correctly, you are saying that the excepted behavior is that the main translation publication status and the node status should be tied, so that if I switch the publication status of a node the status of the translation corresponding to the entity language switches accordingly, right?

Originally this was a feature: I might want to publish a translation in a language differing from the original one and leave the original unpublished. However I agree that this is a minor use case and we might want to drop support for it if it is causing so much trouble here.

What do you think?

miro_dietiker’s picture

Component: Base system » User interface

Oh wow...
I (and 2 others) didn't realize that you can separately enable publishing of a translation for the source language... We didn't see the vertical tab "Translation" or didn't expect to have a separated "translation" publishing state there (corresponding to a/the translation record).

Might be a misunderstanding... At least a major usability issue (I just didn't expect any information from the translation tab to be merged into the source...). Let me think about this.

miro_dietiker’s picture

Hmm... no
In the latest version of entity_translation, the vertical tab "Translation" in the source node is available but always greyed out (disabled).
It even seems the checkbox is always checked and disabled, independently if the translation record is not published.

So publishing the translation of a source that was previously unpublished is impossible with UI now.

plach’s picture

I'd have to check again but the logic originally implemented was that at least one translation has to be published if the node is published. Not necessarily the one related to the original language. If things are grayed out probably you have only one translation published.

haclong99’s picture

the feature is good. Meaning, it might be useful, as you said, to be able to disable one language translation and not another.
But the problem here is : how can we publish the original language node when it is flagged unpublished ? It is greyed out so we can't change its publication status.
If the node is published, then at least one translation has to be published also means that every translation can be published... which is not the case.

And plus : it is somehow the main translation publication status and the node status ARE tied.
At the node creation, when the node is unpublished, then the main translation publication status is unpublished. And at the node creation, when the node is published, then the main translation publication status is published... They are, at a certain point, tied together...

miro_dietiker’s picture

The node itself represents the original "translation" (source language). so greying out is nonsense.
If i want to publish it as/with the first language, i need being able to do so.

Also it's always grey in my case... :-)

So if the edit represents the original / source language, it should also just have an unconditional translation published checkbox as a start.
When creating new things i only ask myself if the translation published checkbox should (by default value when creating a new node) represent the published default state of the node. Alternatively just set it to TRUE by default.

Having the original translation as being "published" is also fine if the node is not published yet.

I see no reason for that disabled state then. Even i would add a warning message if i publish a node and the source translation is not published yet.
Should i provide a patch for that?

plach’s picture

Status: Active » Needs review
StatusFileSize
new1.78 KB

Ok, I tried to test this more thoroughly and I think now I grasp what's the UX issue:

  1. Create an English unpublished node > The "original" translation has unpublished status
  2. Create an Italian translation > The new translation has published status and this cannot be changed since at least one translation must be published
  3. Publish the node > You get the node published only in Italian, while you probably wanted both translations published

Following the suggestions in #25, the attached patch implements these changes:

  • when there is no translation the "original" translation is always published instead of following node status;
  • when creating a translation its status is published by default but can be switched (is not greyed out).

This means that in the scenario above both translations are published when you publish the whole node. You can still decide to unpublish the English translation but you can do that only if the Italian translation is published.

plach’s picture

Status: Needs review » Postponed (maintainer needs more info)

This seems a good fix anyway so I went ahead and committed it.
Please let us know if this can be called fixed.

plach’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new619 bytes

Quoting @miro_dietiker from #1818440: Fatal error with unclean edit path (wrong issue):

Much much better!
(But not perfect yet ;-) )

In addition i think for consistency, we should set the translation status to TRUE for all new nodes. not query for the node status.

Inconsistency example:
Compare case A
Create a node, unpublished
=> status of first translation is UNPUBLISHED
publish the node
=> status of first translation is PUBLISHED
unpublish the node
=> status of first translation is PUBLISHED

If we make the first translation record implicit, we rely on the node "published" state and we rely on the default (source) language.
I thus suggest to make this published as the source language is the initial reference.

The rest seems fine, test coverage is insufficient. Tests pass still without any change. :-)

And reuploading the patch.

plach’s picture

Status: Needs review » Fixed

Makes sense.

Committed and pushed, thanks!

The rest seems fine, test coverage is insufficient. Tests pass still without any change. :-)

Our test coverage currently sucks, although thanks to @bforchhammer is improving. We have an issue for this which will probably become a meta issue at some point: #1770750: Improve test coverage.

Meanwhile I'm tagging all the issues I'd like to see test-covered:

http://drupal.org/project/issues/search/entity_translation?issue_tags=Ne...

plach’s picture

Issue tags: +Needs tests
miro_dietiker’s picture

Cool! Thank you.
No idea why i ended up in the wrong issue... *doh* :-)

Tested and -dev now works cleanly.

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 567da48 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions by plach:
    Issue #1672710 by plach, valencianok | haclong99, miro_dietiker: Fixed...
  • Commit 550be2a on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions authored by miro_dietiker, committed by plach:
    Issue #1672710 by miro_dietiker: Fixed published source node appears as...

  • Commit 567da48 on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions, workbench by plach:
    Issue #1672710 by plach, valencianok | haclong99, miro_dietiker: Fixed...
  • Commit 550be2a on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions, workbench authored by miro_dietiker, committed by plach:
    Issue #1672710 by miro_dietiker: Fixed published source node appears as...