Using Term Reference Tree version 7.x-1.10 and i18n version 7.x-1.13 throws next issue:

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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

darkothenew’s picture

Issue summary: View changes
a.dmitriiev’s picture

The problem is that taxonomy term tree widget doesn't return 'vid' (vocabulary ID) that is needed for i18n_taxonomy_term_name function to work.

The patch to fix it is attached

a.dmitriiev’s picture

The workaround until the patch is committed to the module:

/**
 * Query alter to add vid field to taxonomy tree widget because it is needed for i18n_taxonomy
 */
function your_module_query_alter(&$query) {
	if ($query->hasTag('term_access') && $query->hasTag('translatable')) {
		$query->addField('v', 'vid', 'vid');		
	}
}
a.dmitriiev’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: i18n_taxonomy_notice_vid_missing.patch, failed testing.

a.dmitriiev’s picture

a.dmitriiev’s picture

a.dmitriiev’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
a.dmitriiev’s picture

a.dmitriiev’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
a.dmitriiev’s picture

Status: Needs work » Closed (duplicate)