Hi,
found that i18 needs $term->vid in function i18n_taxonomy_term_name($term, $langcode = NULL)
Taxonomy Term Reference Tree Widget call indirectly this function, without vid, so it cause many php notice (one by term)

i fixed this just by collecting vid in term_reference_tree.module L141
replaced
$result = $select->fields('d', array('tid', 'name'))
by
$result = $select->fields('d', array('tid', 'vid', 'name'))

Comments

blackice2999’s picture

Status: Active » Needs review
StatusFileSize
new607 bytes

hmm it seems there is a problem with # in filenames here...

added new patch file

sharlak’s picture

I have tested this patch and it worked fine for me; thank you!

kunago’s picture

Status: Needs review » Reviewed & tested by the community

There was a warning popping up about an array_flip issue. After changing the line suggested above the warning is gone.
So tested and seems to be working fine.

paulap’s picture

Thx. Works.

Norberto Ostallo’s picture

Works for me too, hope to see it committed soon.

creatile’s picture

The patch doesn't work for me, I still have error messages

    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 441 of /home/www/lefilon7/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).
    Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/www/lefilon7/includes/entity.inc).
    Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /home/www/lefilon7/includes/entity.inc).
    Notice: Trying to get property of non-object in i18n_taxonomy_term_name() (line 441 of /home/www/lefilon7/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).
    Notice: Trying to get property of non-object in i18n_taxonomy_term_name() (line 441 of /home/www/lefilon7/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).

I am using drupal 7.14

The error message only appears when editing fields of content type

I also have some problems to use this module when I use this taxonomy translation mode:
Translate. Different terms will be allowed for each language and they can be translated.
With this mode the terms of different languages will appear in the tree whereas with the localize mode I only have the current language terms.

Thanks

Norberto Ostallo’s picture

The patch seems to solve the problem when the field is required.
For not required fields it seems that the module tries to translate the empty option, generating the error.

KLicheR’s picture

#7, your second problem about seeing all terms for the Translate translation mode is discussed here #1433182: Translation of the taxonomy tree (multiple translated terms inside the same vocabulary).

KLicheR’s picture

The patch #2 work for me.

mikran’s picture

Status: Reviewed & tested by the community » Needs work

I'm also having issues with this patch and non-required fields. Required fields work fine.

mikran’s picture

Status: Needs work » Needs review
StatusFileSize
new2.74 KB

This patch fixes the issues with '#required' => FALSE elements.

rbosscher’s picture

Applied patch #2 with succes, I have no issues with te (non)required field.

k4v’s picture

patch #12 worked for me, thanks =)

Frando’s picture

Status: Needs review » Reviewed & tested by the community

Yup, #12 works and fixes the bug. Setting to RTBC.

FranckV’s picture

Brilliant ! #12 solves all my issues. When do you plan a new release including this necessary patch ?

weri’s picture

The patch #12 works. Please commit.

harryzhxu’s picture

patch #12 for me too

hiro.ifactory’s picture

I have tested the patch #2 and it worked fine for me; thank you!

eidoscom’s picture

I have tested the patch #12 and it worked fine for me!

ilfelice’s picture

FWIW, patch from #12 is working here too (on a Drupal 7.21 installation).

dave reid’s picture

Status: Reviewed & tested by the community » Needs work

This is going to conflict with #1595358: EntityMalformedException when trying to configure settings or edit nodes. It would be good to postpone until that issue lands and then follow-up with the required changes here.

alex72rm’s picture

Version: 7.x-1.9 » 7.x-1.10

The problem apparently is still there with the new version installed:


    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 471 of C:\wamp\www\waw\sites\all\modules\i18n\i18n_taxonomy\i18n_taxonomy.module).
    Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of C:\wamp\www\waw\includes\entity.inc).
    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 471 of C:\wamp\www\waw\sites\all\modules\i18n\i18n_taxonomy\i18n_taxonomy.module).
    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 471 of C:\wamp\www\waw\sites\all\modules\i18n\i18n_taxonomy\i18n_taxonomy.module).
    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 471 of C:\wamp\www\waw\sites\all\modules\i18n\i18n_taxonomy\i18n_taxonomy.module).
    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 471 of C:\wamp\www\waw\sites\all\modules\i18n\i18n_taxonomy\i18n_taxonomy.module).
    Notice: Undefined property: stdClass::$vid in i18n_taxonomy_term_name() (line 471 of C:\wamp\www\waw\sites\all\modules\i18n\i18n_taxonomy\i18n_taxonomy.module).
kubrt’s picture

I confirm that the issue has not been addressed in 7.x-1.10 and the patch #12 worked.

alex72rm’s picture

To be sure to have understood, the patch works for the 1.9 version of the module, but the new version (1.10) is still with the issue unsolved?

mikran’s picture

Assigned: Unassigned » mikran

That's likely to be the case. I'll do a reroll later today, unless you beat me to it

mikran’s picture

Assigned: mikran » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.15 KB

Here is rerolled version.

alex72rm’s picture

It works! Thank you very much!

Norberto Ostallo’s picture

Works for me, too.

roam2345’s picture

Status: Needs review » Reviewed & tested by the community

+1 for patch working for me as well.

andrijic’s picture

bachbach reported and proposed feasible fix on April 2013 prior to the newest 7.x-1.10 release. I just wish I have opened this thread before making a fix myself. This is a good lesson to read bug reports prior to trying to fix it yourself :)

delacosta456’s picture

hi

Patch #27 works for me too.

Thanks

fgm’s picture

Works nicely here too, on taxonomy_term_tree 7.x-1.10 and i18n 1.9.

ptmkenny’s picture

I opened a related issue for ensuring compatibility with Entity Translation as well:

#2101195: Entity Translation (Title module) compatibility

eidoscom’s picture

Patch in #27 is working since June but is not included on las dev snapshot of the module. I think that it must be commited but perhaps is something that I'm missing for this not occur??

Thanks for the patch anyway

pcambra’s picture

Confirming RTBC, patch works fine

heorhi lazarevich’s picture

Patch #27 works for me with Term Reference Tree 7.x-1.10 and i18n 7.x-1.10
Thanks for the patch

Darren Clark’s picture

Also confirmed that patch #27 working correctly with Term Reference Tree 7.x-1.10

ItangSanjana’s picture

#27 did the trick. Thanks ..

ilfelice’s picture

Confirming that #27 works with Term Reference Tree 7.x-1.10 and Drupal 7.24.

Would be nice to see this patch committed. ;)

shi99’s picture

Issue summary: View changes

Also confirming that patch #27 worked with Term Reference Tree 7.x.1.10

Thanks a lot.

Hogeboom’s picture

Great, #27 saves my day! Thx.

jennypanighetti’s picture

When will this get rolled into dev??

jibus’s picture

#27 works for me too, thanks !

zmove’s picture

+1, reviewed and tested by the community. When it can be commited ?

Leeteq’s picture

Yes, RTBC. - time to commit?

jennypanighetti’s picture

Yes please.

ah_ma81’s picture

Thanks for the patch, it is working good.
But i have a big problem, that any (Add Content type) page have a field with Taxonomy Term Reference Tree Widget is very slow ... it takes up to 40 seconds to load.
And before i install i18n, any add content type page did take maximum 5 seconds to load.
Any help please will be appreciated.
Update
I opened new issue for slow Taxonomy Term Reference Tree Widget

pyry_p’s picture

#27 Seems to work.

"// do not use entity_label() for non-term elements"
Just out of curiosity, does this mean you can inject dummy values into the tree or expand the usage otherwise?

fernly’s picture

Confirming that #27 is still doing the job.

jsheller’s picture

Thanks, #27 is working!

Leeteq’s picture

Version: 7.x-1.10 » 7.x-1.x-dev
sylvaticus’s picture

Patch #27 working, thank you.. please commit ;-)

JonasVerhaert’s picture

Thx mirkan for the patch, #27 works!

pacproduct’s picture

Confirming patch #27 works great. Thanks.

krishna savithraj’s picture

Confirming patch #27 works great. Thanks.

matthiasm11’s picture

Patch #27 works, please commit.

pawlus’s picture

Status: Reviewed & tested by the community » Needs work

I think this isn't commited for a reason. And that reason is that when you access node's Edit > Translations, the table there will show a list of node translations along with Add translation and Edit translation options. That options all pass the same language at any given time. So for example Edit links for both French and English version will look like en/node/XX/edit. As a result the widget is passed English language even on French node edit form and it loads only English terms from a vocabulary thus making French terms inaccessible on a French node edit form. This needs to be improved before it's commited. It might be Administration Language meddling, but I don't think it's the case.
EDIT: Just checked, it's not Administration language, this is default behavior.

devad’s picture

Status: Needs work » Reviewed & tested by the community

@Pawlus #58

I suppose that your issue has nothing to do with Taxonomy Term Reference Tree Widget module or patches here.

Did you check if the same links are correct without this module enabled?

Also, please check if your URL detection method is enabled at:
admin/config/regional/language/configure

Or Google something like: Drupal node translation link wrong language. There are many issues created on such topics and there can be many reasons for your problem.

I suppose that we can revert this issue to RTBC since the main target for this issue are multiple PHP notices caused by missing "vid" argument.

hgoto’s picture

The patch #27 still applies cleanly and works well for me. +1 for RTBC.

marttir’s picture

Hopping on the bandwagon here; #27 works for me.

No problems like #58 with taxonomy i18n mode set to 1 (localize).

Delphine Lepers’s picture

The patch #27 works well for me. +1 for RTBC.

hansrossel’s picture

The patch #27 works well for me. +1 for RTBC.

liam morland’s picture

University of Waterloo has been running the patch in #27 for months and it is working for us. +1

yogeshmpawar’s picture

Patch works well, looks good to me +1 for RTBC.

jibus’s picture

Please commit this, the thread is 5 years old and has been set to RTBC last year!

zread’s picture

Tested patch #27, +1

pifagor’s picture

Tested patch #27

  • alex_optim committed add80ed on 7.x-1.x
    Issue #1514794 by mikran, alex_optim: i18n compatibility.
    
alex_optim’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Patch (to be ported)
pifagor’s picture

Status: Patch (to be ported) » Fixed
alex_optim’s picture

Status: Fixed » Closed (fixed)

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