Download & Extend

Wikilinks to images are not parsed correctly

Project:PEAR Wiki Filter
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:critical
Assigned:sibidiba
Status:closed (duplicate)

Issue Summary

Hi,

entering a Wikilink to an existing image in the format [[Image:My image]] results in the following error:

user warning: Unknown column 'f.nid' in 'on clause' query: SELECT n.nid, n.title, f.filename, f.filepath FROM node n LEFT JOIN files f ON n.nid = f.nid WHERE n.status = 1 AND n.type = 'image' AND LOWER(n.title) = LOWER('My image') LIMIT 1 in /var/www/drupal/sites/all/modules/pearwiki_filter/pear_override/render/Xhtml/Image.php on line 58.

Thanks & greetings,
-asb

Comments

#1

Priority:normal» critical
Assigned to:Anonymous» sibidiba
Status:active» needs review

I can confirm this.

Change the query in file modules/pearwiki_filter/pear_override/render/Xhtml/Image.php at line 58 to this:

SELECT n.nid, n.title, f.filename, f.filepath FROM {node} n JOIN {image} i ON n.nid = i.nid JOIN {files} f ON i.fid = f.fid WHERE n.status = 1 AND n.type = 'image' AND LOWER(n.title) = LOWER('%s') LIMIT 1

After that you get:

Fatal error: Unsupported operand types in /home/czigola/public_html/online/includes/common.inc on line 1265.

In the same file at line 68 there is a call to the function url, but with a signature belonging to Drupal API v5!

Change this line to:

$options['attr']['link'] = url("node/$image->nid", Array());

. Now it works.

#2

Status:needs review» closed (duplicate)

This is actually a duplicate of [#264772] and has the same fix.