If in the settings one has selected e.g. "Wiki page" as the node type to be searched,
then
this code
97 $sql = "SELECT title, nid, language FROM {node} WHERE title='%s'";
98 if ($type != 'none') {
99 $sql .= " AND type='%s'";
100 $result = db_query($sql, $title, $type);
101 }
102 $result = db_query($sql, $title);
makes things so that the second call (line 102) uses db_query with the modified $sql var and a missing $type var...
The simple fix is here -
--- plugins/freelinking_nodetitle.inc.orig 2011-09-02 02:48:29.000000000 +0300
+++ plugins/freelinking_nodetitle.inc 2012-07-16 19:10:29.353020303 +0300
@@ -113,7 +113,9 @@ function freelinking_nodetitle_nid_from_
$sql .= " AND type='%s'";
$result = db_query($sql, $title, $type);
}
- $result = db_query($sql, $title);
+ else {
+ $result = db_query($sql, $title);
+ }
$set = array();
while ($res = db_fetch_object($result)) {
I sent this to juampy via PM along with a RQ for a co-maintainer since I am ready and willing to help this module..
Cheers.
PS. Bug is present in both latest stable and dev.
Comment | File | Size | Author |
---|---|---|---|
#2 | freelinking 1688000.patch | 479 bytes | hhofer |
Comments
Comment #1
juampynr CreditAttribution: juampynr commentedThe needs review status is used to review patches. Please write a patch against branch 6.x-3.x and attach it here.
Comment #2
hhofer CreditAttribution: hhofer commentedI just stumbled over this bug. The proposed fix works for me. I attached a patch against Version 6.x-3.x-dev.
Comment #3
gisleDupe - and none of the code this patch touches is left. This has been fixed in 6.x-3.4.