Steps to reproduce:

Enable the links and weblink module and then immediately click on the 'weblink' link. You'll receive the error:

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 ') AND n.type='weblink' AND n.status=1 ORDER BY n.title' at line 1 query: SELECT DISTINCT n.nid, n.title FROM node n, term_node tn WHERE n.nid=tn.nid AND tn.tid IN () AND n.type='weblink' AND n.status=1 ORDER BY n.title in includes\database.mysql.inc on line 118.

Here's a patch that just surrounds that code with an if (count($terms)) { ... } to ensure that there is at least one term available to use as an argument.

CommentFileSizeAuthor
links_weblink.module_1.patch1.38 KBwebchick

Comments

Bèr Kessels’s picture

Status: Needs review » Reviewed & tested by the community

Look good. It fixes the bug. and does not introduce anything new.

syscrusher’s picture

Assigned: Unassigned » syscrusher
Status: Reviewed & tested by the community » Fixed

I agree, Ber. Good patch, Webchick, and thanks. It's committed to CVS today.

Scott

Anonymous’s picture

Status: Fixed » Closed (fixed)