Bug when used with pathauto

albert_philly - September 26, 2008 - 01:11
Project:Related links
Version:5.x-2.2-beta
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

By default, pathauto gives nodes the link /content/title-of-node. For user submitted links using the autocomplete feature, related links creates its link as node/nid.

When a user clicks on the link, they end up at /content/node/nid and a 404 error.

Patch makes two changes to use the l() function when outputting links and not use url() when inserting links into the database.

AttachmentSize
wrongurls.patch1.02 KB

#1

kingandy - October 24, 2008 - 15:40

FWIW, I don't think it's fair to blame this on pathauto - it's just how web browsers handle what appears to be a relative link (ie, no leading slash or protocol). If you were looking at /node/nid and clicked on a href="node/nid" link you'd find yourself at /node/node/nid ... TBH I'm surprised to find a hardcoded link like that hanging around in what is otherwise a finely-crafted module. I suspect that and the url() usage are both throwbacks to a darker time, a time when the $_GET['q'] reflected the path in the URL rather than the internal system path.

Cheers for this patch, just what I was looking for :)

 
 

Drupal is a registered trademark of Dries Buytaert.