Opened 16 years ago

Closed 16 years ago

#86 closed defect (fixed)

redirects under mod_perl

Reported by: Dominic Hargreaves Owned by: Dominic Hargreaves
Priority: normal Milestone:
Component: openguides Version: svn
Severity: normal Keywords:
Cc:

Description

From crschmidt:

Currently, when running OpenGuides under mod_perl, redirects do not work, because the Apache $r object associated with the CGI object do not exist. (You get an error message: Can't call method "send_cgi_header" on an undefined value at (eval 64) line 62.)

This happens both after an edit, and when following redirects, and possibly in other cases as well.

After some investigation last night, I tracked the source of this down: currently, OpenGuides redirects use a class method of CGI:

CGI->redirect($redirectparams);

However, this does not work. It seems that class methods in this case never initialize the Apache request variable that is needed in order to send_cgi_header.

The solution for this, is to replace CGI->redirect calls with:

my $q = new CGI;
$q->redirect($redirectparams);

I have too little knowledge to be able to speak to whether this is a fault within CGI or a fault within OpenGuides usage of it. However, this change has allowed me to successfully use mod_perl on the Open Guide to Boston in testing, and this fix or a similar fix should probably be integrated into OpenGuides in either case, since upgrading the system CGI.pm is a difficult task. The current debian packages for stable include mod_perl 1.999.021, which is not compatible with CGI.pm 3.16, and upgrading mod_perl requires a full removal due to an API rename (as described at http://perl.apache.org/docs/2.0/rename.html).

The code that needs to be changed is in OpenGuides.pm, in two functions:

sub redirect_to_node
sub find_within_distance

A patch which makes these changes is attached.

Attachments (1)

modperl.patch (845 bytes) - added by Dominic Hargreaves 16 years ago.
patch

Download all attachments as: .zip

Change History (3)

comment:1 Changed 16 years ago by Dominic Hargreaves

Status: newassigned

Changed 16 years ago by Dominic Hargreaves

Attachment: modperl.patch added

patch

comment:2 Changed 16 years ago by Dominic Hargreaves

Resolution: fixed
Status: assignedclosed

(In [735]) Fix mod_perl redirect bug (closes #86)

Note: See TracTickets for help on using tickets.