OS: Linux opendistro, kernel: v2.6.39.2
Database: mysql 5.1.39
apache: 2.2.15
PHP 5.2.9
PHP error_reporting = E_ALL & ~E_NOTICE
Drupal 6.22

We're using term_node_count for taxonomy terms with a content profile (is a content type with taxonomy term fields) associated with each user. One example of the taxonomy terms used are the user's neighborhood. When saving the content profile, an error message is logged when going from some number of terms and resaving with zero terms.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT parent FROM term_hierarchy WHERE parent != 0 AND tid IN (109,) in /Applications/MAMP/htdocs/drupal/sites/all/modules/term_node_count/term_node_count.module on line 127.

Repeatable: Always

Steps to repeat:
Save content profile with multiple terms.
Edit content profile and turn off all taxonomy terms.
Resave.

Comments

freebug’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB

The problem arises when there is a multiple select taxonomy vocabulary.

If the "None" for this vocabulary is selected and no other taxonomy terms from the same vocabulary or another vocabulary is selected for a particular node.

The attached patch might solve this problem.

johne’s picture

Thanks for the patch to try, but I keep getting errors trying to apply it. I'm using patch v2.5.8 on my mac, but get the same errors trying this on our linux server. patch doesn't seem to like the lines that mention a newline

patch: **** malformed patch at line 25: \ No newline at end of file

But, I still get that error if I use the -u option for unified format. If I remove the newline lines I get:

Hunk #1 FAILED at 88.

johne’s picture

Status: Needs review » Active

I also tried using git to apply this patch.

error: term_node_count.module Locally Modified (Based On LOCAL): No such file or directory

This is on a version I just got using git, so I don't understand the error. It looks more like this patch is also incompatible with git.

gorbeia’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

I have not tested if the patch fixes the issue, but I have applied it manually and generated a new patch using git.

gorbeia’s picture

Issue summary: View changes

updated description with repeatability steps