Hi all,
I set all my content types for entity translation (and all was well), but now have found that some content types would do better to be 'content translated'.
So I deleted all the content for those types, changed the translation setting to 'enable translation' for the content type and start readding content.
When I translated a node, I got redirected to the translated node and an error of 'English translation unavailable for ..' for my translated content. I then looked in the ET table and found the node Ids in there. When I deleted the ids from the table, it was all working fine.
So I thought that maybe this just happens for a content type that gets switched from 'ET' to 'content', so I created a new content type in case just to test. Turns out the same problem happened and the nodes are found in the entity_translation table. Again when I manually deleted the node ids from the table, all was fine.
Hope this helps people out.
Thanks.
Comments
Comment #1
farse commentedI don't know if this makes any difference, I have the 'body' field set as translateable through other content types, so when I set a new content type to 'enable translation' (content trans) and when I looked at the body field, under 'body field settings' it says 'Field translation: Users may translate this field. Disable translation'. so I don't know if this has something to do with making the node id go into the entity_translation table without enabling field translation on the content type.
Comment #2
farse commentedComment #3
farse commentedAlso, when checking in Config > entity translation, the content types do not show up indicating that they shouldn't be entity translated.
have been looking around the ET module, but am still getting used to the way drupal modules are constructed so haven't gotten very far.
the only things that have caught my eye are
line 80 in entity_translation.node.inc
with a reference to it in entity_translation.module at line 65
Comment #4
farse commentedThis actually seems to be the bit that inserts the nid into entity_translation (saveTranslations). Seems that it doesn't distinguish itself between different entity types (ie. nodes, taxonomy, users). If there was a way to then check if the bundle is translatable, I would think this would solve the issue?
Comment #5
farse commentedreferring to my comment#4 i made an amendment that I think prevents putting the node id in the entity_translation table if the bundle is not entity translatable. this is my first ever drupal patch, so any constructive comments would be appreciated if I have done it wrong.
thanks
Comment #6
plachLet's see what the bost thinks about this.
Comment #8
farse commentedis this because I made the patch wrong? or was the code bad?
do I have to pull on the latest dev version and then make the patch from that?
Comment #9
plachYes, the patch should be rolled against the latest dev code. A quick code review:
You have trailing whitespaces here.
Comments should start with a capital letter and end with a trailing dot, see the coding standard documentation. Also I'd change this to:
Comment #10
farse commentedthanks for the comments, will do.
Comment #11
plachAnother minor nitpick: there's a missing space after the if.
Comment #12
farse commentedok, cloned from current dev version and made suggested changes. let's try this again.
Comment #14
farse commentedComment #16
plachSome coding standard quirks here.
These lines were erroneously copied.
Comment #17
plachPlease disregard work.patch, I didn't mean to upload it.
Comment #18
bforchhammer commentedThanks, committed and pushed :)
Comment #19
farse commentedThanks for helping with the patch. Didn't really know how to progress from my last failed one, but looking at the differences, what exactly was causing it to fail so badlly? The only difference i saw was that the comment was continued on a second line... ?
Comment #20
plachYou copied the body of the insert hook implementation into the body of the update one:
instead of:
This broke translation editing :)
Comment #21.0
(not verified) commentedgrammar