Closed (duplicate)
Project:
Pathauto
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2006 at 04:44 UTC
Updated:
19 Nov 2006 at 18:40 UTC
I have installed pathauto dated November 12, 2006 - 10:56 into drupal 5beta1
I have a flex taxonomy defined for blog nodes. I made a blog posting and it gives me these messages:
* warning: Illegal offset type in /var/www/vhosts/visforvoltage.org/httpdocs/modules/taxonomy/taxonomy.module on line 1087.
* warning: Illegal offset type in /var/www/vhosts/visforvoltage.org/httpdocs/modules/taxonomy/taxonomy.module on line 1088.
* warning: Illegal offset type in /var/www/vhosts/visforvoltage.org/httpdocs/modules/taxonomy/taxonomy.module on line 1091.
* warning: Illegal offset type in /var/www/vhosts/visforvoltage.org/httpdocs/modules/taxonomy/taxonomy.module on line 1087.
* warning: Illegal offset type in /var/www/vhosts/visforvoltage.org/httpdocs/modules/taxonomy/taxonomy.module on line 1088.
* warning: Illegal offset type in /var/www/vhosts/visforvoltage.org/httpdocs/modules/taxonomy/taxonomy.module on line 1091.
The relavent code maps here:
function taxonomy_get_term($tid) {
static $terms = array();
if (!isset($terms[$tid])) { // line 1087
$terms[$tid] = db_fetch_object(db_query('SELECT * FROM {term_data} WHERE tid = %d', $tid));
}
return $terms[$tid];
}
Scratching my head a little bit I added this line of code
if (!in_array($tid, $terms)) return "";
And the error messages went away. Clearly $tid is not in $terms.
Comments
Comment #1
cog.rusty commentedHmm... isn't $terms an array of database objects. Why should it contain $tid?
I don't understand php, so ignore it if it off mark.
Comment #2
pwolanin commentedI would guess this is a problem with pathauto not taxonomy- $tid should be an integer- maybe put some debugging code in like:
Comment #3
reikiman commentedI also was wondering if it's a pathauto problem, so I filed an issue with that module here:
http://drupal.org/node/98510
Comment #4
reikiman commentedI put the above debugging code in, and got these messages:
Comment #5
reikiman commentedThis was already filed against pathauto: http://drupal.org/node/92900
Comment #6
RobRoy commentedDupe.