Closed (fixed)
Project:
Localizer
Version:
5.x-3.3
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2008 at 05:56 UTC
Updated:
26 Nov 2009 at 16:25 UTC
Hi there,
I'm receiving the following PHP error when previewing a form which contains autocomplete fields (created with CCK and content_taxonomy):
warning: Illegal offset type in isset or empty in /sites/all/modules/localizer/taxonomy/taxonomy.module on line 1187.
warning: Illegal offset type in /sites/all/modules/localizer/taxonomy/taxonomy.module on line 1188.
warning: Illegal offset type in /sites/all/modules/localizer/taxonomy/taxonomy.module on line 1189.
warning: Illegal offset type in /sites/all/modules/localizer/taxonomy/taxonomy.module on line 1189.
warning: Illegal offset type in /sites/all/modules/localizer/taxonomy/taxonomy.module on line 1192.
I've checked the mentioned lines. $tid in function taxonomy_get_term() is 0. Therefore the performed query and $terms[$tid] are empty. I've changed the function a little bit and now I don't get any PHP error message (but I'm not sure if this is a clean solution):
function taxonomy_get_term($tid) {
static $terms = array();
if ($tid[0] != 0) {
if (!isset($terms[$tid])) {
$terms[$tid] = db_fetch_object(db_query('SELECT * FROM {term_data} WHERE tid = %d', $tid));
if (function_exists('to')) $terms[$tid] = to('taxonomy_term', $tid, $terms[$tid]);
}
return $terms[$tid];
}
}
Can anyone confirm and test my changes?!
Comments
Comment #1
Roberto Gerola commentedDid you add this condition :
if (!isset($terms[$tid])) {
I think this has nothing to do with localizer. Another module is screwing up here.
Disable localizertaxonomy and try again.
If the problem persist, the problem is on another module.
Comment #2
bjacob commentedYour absolutelly right. It's not related to localizer but to content_taxonomy...
Comment #3
Roberto Gerola commentedComment #4
harcher commentedIt would have been nice if you shared with us how you got this fixed.
I'm having the same issue