To reproduce this issue, please install 7.x-1.10 or 7.x-1.x-dev version of i18n module on a clean Drupal 7 website, generate some content (nodes, taxonomy fields), enable couple, three languages, activate Taxonomy translation module and go to Edit tab of any node to get:

Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 461 of /home/website/public_html/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of /home/website/public_html/includes/entity.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 350 of /home/website/public_html/includes/entity.inc).
Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 461 of /home/website/public_html/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).

I know there were some similar discussions, for example on https://drupal.org/node/1802468, but (1) I tried all the patches with no joy and (2) they in that page never mentioned about Taxonomy translation module involved. And it is obviously about Taxonomy translation because the error goes away if I turn off this module.

Comments

cmunk’s picture

I have the same error on the regular version of i18. Did you find a fix?

adiatis’s picture

Same problem here. Is there any fix available?

aaagepard’s picture

The same. Any news?

cpelham’s picture

I just installed and added a node and am getting a similar error:

Notice: Trying to get property of non-object in i18n_taxonomy_term_name() (line 461 of /customers/b/5/c/mysite.com/httpd.www/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).

yngens2’s picture

Issue summary: View changes

Unfortunately, no solution yet.

rodrigoaguilera’s picture

I runned into this while doing a term migration. I ended up disabling hook_taxonomy_term_presave inside i18n_taxonomy during the migration.

darkothenew’s picture

I find solution for this issue. It is an issue with Taxonomy Term Reference Tree Widget and i18 module where function in i18 need $term->vid property not provided by function in Term Reference Tree.

function i18n_taxonomy_term_name($term, $langcode = NULL)
on line 461 need vid:
return i18n_taxonomy_vocabulary_mode($term->vid....

Go to term_reference_tree.module and on line 142 do next:
$query->fields('t', array('tid', 'name'));
change to:
$query->fields('t', array('tid', 'vid', 'name'));

The function is called indirectly, with no provided vid, and it cause many PHP notice (one by every used term).
If this fix cause some functionality issue maybe you need to apply this PATCH.

Hope this will help you.

josecarlos1977’s picture

Gracias darkothenew. Me funcionó perfecto.

pinueve’s picture

+1 to #7, works perfect

Christophe Bourgois’s picture

+1 to #7, works perfect

mariano.barcia’s picture

#7 fixes this annoying problem. Thank you @darkothenew!

mariano.barcia’s picture

Status: Active » Reviewed & tested by the community
weri’s picture

Related issues: +#1514794: i18n compatibility

When the "Taxonomy Term Reference Tree Widget" is used, the following issue fixes the problem: #1514794: i18n compatibility

Maybe we can close this issue?

jcnventura’s picture

Status: Reviewed & tested by the community » Active

There's no patch here, and it seems the patch applies to the "Taxonomy Term Reference Tree Widget" module anyway.

devad’s picture

Status: Active » Closed (duplicate)
Related issues: +#2101195: Entity Translation (Title module) compatibility

I suppose we can close this as duplicate of #1514794: i18n compatibility. Patch is available there and tested as RTBC.

Related issue for those using Entity Translation: #2101195: Entity Translation (Title module) compatibility.

If this issue is related to something more than Taxonomy Term Reference Tree Widget issue quoted above, and is actually related to Internationalization module itself... please feel free to reopen.