Invalide node path if no Wikitools/Freelinking/Liquid is used
| Project: | PEAR Wiki Filter |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
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().
| Attachment | Size |
|---|---|
| node_path.patch | 1.55 KB |

#1
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.