When creating a node and translating it the cache for the original node doesn't get reset. So both the translate tab shows a add translation link in the translate tab on the original node.

In the cache the node doesn't have a tnid so it shows the add translation link instead of the translated node.

To reproduce:
1. Enable entity cache
2. Enable i18n and set a node type to be multilanguage with translations
3. Have 2 enabled languages
4. Create a node in language 1
5. Translate that node through translate tab
6. Go to the translate tab on the original node(Langauge 1). It will show a "add translation" link even though there is a translation in the db and you can't create a translation.
7. Clear cache and see the "add translation" link disappear.

Files: 
CommentFileSizeAuthor
#23 add-translation-information-on-each-request-1349566-23.patch1.62 KBjrbeeman
PASSED: [[SimpleTest]]: [MySQL] 6,361 pass(es).
[ View ]
#20 clear-cache-when-translating-1349566-19.patch1.24 KBlex0r
FAILED: [[SimpleTest]]: [MySQL] 6,360 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#12 add-translation-information-on-each-request-1349566-12.patch1.55 KBDevin Carlson
PASSED: [[SimpleTest]]: [MySQL] 6,361 pass(es).
[ View ]
#12 add-translation-information-on-each-request-1349566-12-tests-only.patch743 bytesDevin Carlson
FAILED: [[SimpleTest]]: [MySQL] 6,346 pass(es), 16 fail(s), and 0 exception(s).
[ View ]

Comments

same here!

Issue tags:+i18n compatibility

Tagging.

Version:7.x-1.1» 7.x-1.x-dev

Cannot reproduce with the latest version of i18n. Please update to i18n-7.x-1.3.

Ohh no. You are right. There are some issues. I am working on it.

Hi, Any advance with this, i cannot figure what to do to enable entity cache with i18n active. if you give me some orientation i can try to solve it...

Best
David

That patch does appear to solve this issue for me. Although from the look of the #1405234: Implement update hooks for node translation sets. Clean-up node translation sets. thread it doesn't sound like it will be the final solution.

edit - actually I was mistaken, that patch didn't solve it at all.

I had success with this patch: http://drupal.org/node/1463402#comment-6137776

Not really. This issue relates to traditional node translation, whereas #1851430: cache per language relates to translations within a single node, i.e. using the entity_translation module.

Status:Active» Needs review
StatusFileSize
new743 bytes
FAILED: [[SimpleTest]]: [MySQL] 6,346 pass(es), 16 fail(s), and 0 exception(s).
[ View ]
new1.55 KB
PASSED: [[SimpleTest]]: [MySQL] 6,361 pass(es).
[ View ]

I ran into this while investigating #2070127: Source translated wiki page is not connected to translated pages. The issue can be demonstrated by running the core Translation module's test cases with Entity Cache enabled.

I believe the solution would be to force the translation information to be added on each request, à la book_node_load() in book_entitycache_node_load(), to avoid expensive cache clearing in order to get "accurate" translation information.

Status:Needs review» Needs work

Status:Needs work» Needs review

@Devin Carlson: I just manually added the translation_entitycache_node_load() implementation from #12 and it works for me so far!

Patch #13 translation_entitycache_node_load() works for me also..

Issue summary:View changes
Status:Needs review» Reviewed & tested by the community

Works well here too. Thanks @Devin Carlson.

Hi guys,
what about not doing extra queries each time node is loaded from cache? I will post a solution soon. The idea is to clear entity cache when entity is translated. We do it once and then there's no need to query database each time - PROFIT :)

Here is a patch that evades doing unnecessary selects each time a node is loaded from cache (slightly better performance than #12).

StatusFileSize
new1.24 KB
FAILED: [[SimpleTest]]: [MySQL] 6,360 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Sorry, didn't figure it out how to add comments and files :)

Status:Reviewed & tested by the community» Needs work

The last submitted patch, 20: clear-cache-when-translating-1349566-19.patch, failed testing.

The last submitted patch, 20: clear-cache-when-translating-1349566-19.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1.62 KB
PASSED: [[SimpleTest]]: [MySQL] 6,361 pass(es).
[ View ]

Re-roll patch from #12 against latest 7.x-1.x-dev

@jrbeeman, you didn't like SQL-less solution from #20?

the patch in #23 works whith the node translations (tnid), thanks!

whe have the same problem with the terms translations and the field tsid

I have the same problem and I don't have Entity Cache enabled.
Drupal 7.25

We also have the same issue, on our latest projects, but don't have entity cache enabled. So the bug could be somewhere else so it looks... Lets see if we can find out something, but nobody has an idea yet about that?
We probably should make a separate ticket which does show how to reproduce the problem without entity cache...

For those who don't use "entity cache" module and are having this issue:

Looks like I found the issue, please see this ticket here which solves the problem for me.
See comment 24 which has the patch (and seems to be in the current dev release of i18n).

This, or my issue, also had nothing to do with the "entity cache" module. (not using it)