1.5.7 + mod_perl2 (WAS: Re: [freeside-users] Error when adding
customer)
Charles Sprickman
spork at bway.net
Wed Feb 7 18:27:17 PST 2007
On Wed, 31 Jan 2007, Richard Siddall wrote:
> Charles Sprickman wrote:
>> Hello,
>>
>> I just recently got Freeside mostly running. When I click on the "new
>> customer" link, I get the following error:
>>
>> error: Can't locate object method "send_http_header" via package
>> "Apache2::RequestRec" at /usr/local/lib/perl5/site_perl/5.8.8/FS/CGI.pm
>> line 171.
>> context:
>> ...
>> 167: =cut
>> 168:
>> 169: sub eidiot {
>> 170: warn "eidiot depriciated";
>> 171: $HTML::Mason::Commands::r->send_http_header
>> 172: if defined $HTML::Mason::Commands::r;
>> 173: idiot(@_);
>> 174: &myexit();
>> 175: }
>> ...
>> code stack: /usr/local/lib/perl5/site_perl/5.8.8/FS/CGI.pm:171
>> /home/freeside/edit/cust_main.cgi:94
>> /home/freeside/autohandler:1
>>
>> Any ideas?
>>
>
> That code is for mod_perl 1.x. Either replace Apache 2.x / mod_perl 2.x
> with Apache 1.x / mod_perl 1.x, or apply the mod_perl 2.x patch from
> http://www.sisd.com/pipermail/freeside-devel/2005-September/000521.html
Excellent!
Nowhere in the install docs is there any mention that the current stable
version of Freeside does not work with the current version of
apache/mod_perl, so I'd be lost without this.
There is mention of it in the docs for the new version, but I would never
have thought to look there.
Anyhow, I changed the subject so some future hapless non-mod_perl lacky
might find this.
Also, here's the relevant patch for mod_perl2 extracted from the archived
message:
diff -Naur freeside-1.5.7.orig/FS/FS/CGI.pm freeside-1.5.7/FS/FS/CGI.pm
--- freeside-1.5.7.orig/FS/FS/CGI.pm 2004-12-10 17:28:25.000000000
-0500
+++ freeside-1.5.7/FS/FS/CGI.pm 2005-07-26 22:41:07.000000000 -0400
@@ -91,7 +91,8 @@
if ( $header =~ /^Content-Type$/ ) {
$HTML::Mason::Commands::r->content_type($value);
} else {
- $HTML::Mason::Commands::r->header_out( $header => $value );
+ # Modified for mod_perl 1.99+
+ $HTML::Mason::Commands::r->headers_out->{ $header } = $value;
}
} else {
die "http_header called in unknown environment";
@@ -168,8 +169,9 @@
sub eidiot {
warn "eidiot depriciated";
- $HTML::Mason::Commands::r->send_http_header
- if defined $HTML::Mason::Commands::r;
+# Disabled for mod_perl 1.99+, should be an eval{}
+# $HTML::Mason::Commands::r->send_http_header
+# if defined $HTML::Mason::Commands::r;
idiot(@_);
&myexit();
}
> Regards,
>
> Richard.
>
> _______________________________________________
> freeside-users mailing list
> freeside-users at sisd.com
> http://420.am/cgi-bin/mailman/listinfo/freeside-users
>
More information about the freeside-users
mailing list