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

Roberto Gerola’s picture

Category: bug » support

Did 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.

bjacob’s picture

Your absolutelly right. It's not related to localizer but to content_taxonomy...

Roberto Gerola’s picture

Status: Needs review » Closed (fixed)
harcher’s picture

It would have been nice if you shared with us how you got this fixed.

I'm having the same issue