Hi,

I get the following warnings on admin/content/taxonomy:

    * notice: Undefined variable: type in /var/www/drupal_6.1_20070904/html/modules/node/node.module on line 370.
    * notice: Undefined index: in /var/www/drupal_6.1_20070904/html/modules/node/node.module on line 370.

These warnings are printed once for each vocabulary listed.

Cheers,
Stella

Comments

stella’s picture

I also get the following warnings when I use the taxonomy_term_count_nodes() function:

* notice: Undefined index: 81 in /var/www/drupal_6.1_20070904/html/modules/taxonomy/taxonomy.module on line 808.
* notice: Undefined variable: children_count in /var/www/drupal_6.1_20070904/html/modules/taxonomy/taxonomy.module on line 784.
* notice: Undefined index: 85 in /var/www/drupal_6.1_20070904/html/modules/taxonomy/taxonomy.module on line 784.
* notice: Undefined variable: children_count in /var/www/drupal_6.1_20070904/html/modules/taxonomy/taxonomy.module on line 782.

Cheers,
Stella

xqus’s picture

StatusFileSize
new672 bytes

This patch should fix the errors in node.module.

pwolanin’s picture

Status: Active » Needs review

looks like a start - but is taxonomy module making the call with the wrong params?

pwolanin’s picture

Title: undefined type warnings » undefined type warnings on taxonomy admin pages
StatusFileSize
new2.38 KB

here's a more thorough patch - solves the root problem in taxonomy module (the LET JOIN may return a NULL for type), but also adds a check to node module similar to the patch above.

pwolanin’s picture

StatusFileSize
new2.73 KB

correct doxygen for node_get_types() - it's already the case that FALSE may be the return value.

kkaefer’s picture

Status: Needs review » Reviewed & tested by the community

Changes look sane and fix the problem.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed!

stella’s picture

Status: Fixed » Active

Well the patch from comment #5 fixed all the warning issues I had with the category admin page (admin/content/taxonomy) and fixed the warnings on the faq page which calls the taxonomy_term_count_nodes() function. However, I now get the following warning for the taxonomy module on the faq page, again when using taxonomy_term_count_nodes():

notice: Undefined index: 85 in /var/www/drupal_6.1_20070904/html/modules/taxonomy/taxonomy.module on line 791.

Cheers,
Stella

pwolanin’s picture

Status: Active » Fixed

Please open a new issue and post a link here if you think there is an additional/different bug.

stella’s picture

Status: Fixed » Active

No, it's the same issue.

line 784 in the taxonomy.module before the patch was:

 return $count[$type][$tid] + $children_count;

After the patch, this is now line 791. So basically I'm now getting the same error as in comment #1 for the same line, except the line number has changed. Sorry, I should have been clearer on this. I should have said that one of the warnings in comment #1 was fixed, but the other wasn't.

Cheers,
Stella

pwolanin’s picture

Status: Active » Needs review
StatusFileSize
new788 bytes

I'm not sure what the "faq" module is.

However, looking at the code it's pretty obvious that the value being returned may not set. Try the attached patch.

pwolanin’s picture

StatusFileSize
new707 bytes

actually that patch isn't good enough - here's one that should be more correct and general.

stella’s picture

The patch from comment #12 fixed the warnings for me. Thanks!

Cheers,
Stella

pwolanin’s picture

Status: Needs review » Reviewed & tested by the community

ok - since this is a trivial and obvious change I won't feel bad marking it RTBC.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

OK, thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)