Ticket #86 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

redirects under mod_perl

Reported by: dom Owned by: dom
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

modperl.patch (0.8 kB) - added by dom 3 years ago.
patch

Change History

Changed 3 years ago by dom

  • status changed from new to assigned

Changed 3 years ago by dom

patch

Changed 3 years ago by dom

  • status changed from assigned to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.