Invalide node path if no Wikitools/Freelinking/Liquid is used

fuerst - February 26, 2008 - 16:39
Project:PEAR Wiki Filter
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I found two bugs regarding the handling of node paths if no Wikitools/Freelinking/Liquid is used to create the path from Links like [[The Page Title]]. Please review the attached patch against pearwiki_filter.module 1.11

#1: If no Wikitools/Freelinking/Liquid is used the node path will be looked up by the node title in the node table. At this time spaces in the node title are already replaced by the space replacement you configured for PEAR Wiki Filter (or underscore in case of the Mediawiki format). As a result the lookup query is searching the node table for i.e. "The_Page_Title" instead of "The Page Title" and will never find the corresponding node. Fix is to undo the space replacement on-the-fly inside the SQL query. Additional drupal_get_path_alias() is called to get any URL Alias for the node path.

#2: If still no corresponding node is found the (space replaced) node title will be used as path. Because it is run through urlencode() all slashes will be replaced by %2F which results in invalide paths. Fix here is to rechange %2F to slashes using str_replace().

AttachmentSize
node_path.patch1.55 KB

#1

sebastien.barre - February 16, 2009 - 01:19

As of today, this bug is still definitely in, and this patch will fix it.

This is relevant if you do not wish to have users auto-create nodes the way a regular Wiki do, but still want to let user familiar with Wikis use the markup syntax.

 
 

Drupal is a registered trademark of Dries Buytaert.