#86: redirects under mod_perl -------------------+-------------------------------------------------------- Reporter: dom | Owner: dom Type: defect | Status: new Priority: normal | Component: openguides Version: svn | Severity: normal Keywords: | -------------------+-------------------------------------------------------- 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.
#86: redirects under mod_perl ---------------------+------------------------------------------------------ Reporter: dom | Owner: dom Type: defect | Status: assigned Priority: normal | Component: openguides Version: svn | Severity: normal Resolution: | Keywords: ---------------------+------------------------------------------------------ Changes (by dom):
* status: new => assigned
#86: redirects under mod_perl ---------------------+------------------------------------------------------ Reporter: dom | Owner: dom Type: defect | Status: closed Priority: normal | Component: openguides Version: svn | Severity: normal Resolution: fixed | Keywords: ---------------------+------------------------------------------------------ Changes (by dom):
* resolution: => fixed * status: assigned => closed
Comment:
(In [735]) Fix mod_perl redirect bug (closes #86)
openguides-tickets@lists.openguides.org