drupal_goto call fails when site uses several languages

jseffel - December 3, 2008 - 13:18
Project:DruTeX
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Steven Jones
Status:patch (to be ported)
Description

When a user clicks the "Generate PDF/Latex" links he/she will see a 404 if the site uses language prefixes in the URL (http://foo.bar//node/100) because Drutex uses the drupal_goto() call which only should be used for drupal-pages.

I made a quick hack just to make it work on out site.

AttachmentSize
redir.patch470 bytes

#1

MGN - December 12, 2008 - 01:38
Status:active» needs review

I think drupal_goto() is still the preferred function call - if you look at the function, it ends up calling header(), but should be safer and allows other modules to react to the redirect. None of the modules in the core (and none of the 30+ contrib that I use) call header directly. I think the real issue is in the use of $base_url. The following patch works for me, can you see if it solves the problem for you?

AttachmentSize
342093-drutex-base_url.diff 907 bytes

#2

Steven Jones - January 4, 2009 - 16:28
Assigned to:Anonymous» Steven Jones
Status:needs review» patch (to be ported)

Committed to 6.x-1.x

 
 

Drupal is a registered trademark of Dries Buytaert.