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.

CommentFileSizeAuthor
#2 freelinking 1688000.patch479 byteshhofer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr’s picture

Status: Needs review » Needs work

The needs review status is used to review patches. Please write a patch against branch 6.x-3.x and attach it here.

hhofer’s picture

Status: Needs work » Needs review
FileSize
479 bytes

I just stumbled over this bug. The proposed fix works for me. I attached a patch against Version 6.x-3.x-dev.

gisle’s picture

Version: 6.x-3.x-dev » 6.x-3.4
Issue summary: View changes
Status: Needs review » Closed (duplicate)
Parent issue: » #1253878: Nodetitle plugin type selection and title processing broken [Patch provided]

Dupe - and none of the code this patch touches is left. This has been fixed in 6.x-3.4.