Hi, I set up the module on drupal 6.4 as per normal, then created a new vocab for the tags, and then enabled the active_tags and popular widgets, edited an exsisting node, added two new tags, and saved the node, the error message generated is attached. My backend is PostgreSQL.

CommentFileSizeAuthor
active_tags_error.png20.87 KBspydmobile

Comments

darrenmothersele’s picture

Version: 6.x-1.x-dev » 6.x-1.1
Assigned: Unassigned » darrenmothersele

Right, the SQL needs a tweek there to make it pgsql compatible. Sorry this was only tested on MySQL.

Can you change the SQL query in activetags_popular.module so that line 39 of the file reads thus...

  $result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = %d GROUP BY t.name, t.tid ORDER BY COUNT(t.name) DESC", 't', 'tid'), $vid, 0, variable_get('active_tags_popular_no_'. $vid, 10));

There's just the addition of ", t.tid" between GROUP BY and ORDER BY.

Can you let us know if that fixes the SQL error you are seeing.

Thanks

spydmobile’s picture

That appears to have fixed it, Thanks. Would I expect teh next release of the module to contain this fix?

darrenmothersele’s picture

Status: Active » Reviewed & tested by the community

Thanks for confirming this works.

I will commit to CVS and this will go into the next release. Once it's up there I'll set up a 6.x-dev release which will contain this.

Anonymous’s picture

Status: Reviewed & tested by the community » Active

I've got the same issue, however it's working fine on my local machine which has MySQL 5 - looks like my host has MySQL 4.

The first user comment on this page alludes to a work-around but I can't get it working myself:

http://dev.mysql.com/doc/refman/4.1/en/group-by-optimization.html

Would appreciate any help getting this [very cool] feature working!

dragonwize’s picture

Title: SQL query errors out when saving tags, may be PGSql related » SQL group by issues, pgSQL and MySQL 4
dragonwize’s picture

dragonwize’s picture

Status: Active » Closed (duplicate)

Merging this issue with #325467: Popular tags are not popular & SQL group by issues on pgSQL and MySQL 4 because they both affect the same line and will be easier to fix with one patch.