Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [yogi] page.cgi Bug Report - Fix Anyone?

Quote Reply
Re: [yogi] page.cgi Bug Report - Fix Anyone? In reply to
Did you release the page builder plugin?

I know you were trying to override the Links::Fatal call.



A quick and dirty work around is found at the top of the Site_Html.pm

Code:
sub display {
# -----------------------------------------------------------------
# Returns a specified template parsed.
#
my ($template, $vars, $opts) = @_;
my $code = exists $Links::SiteHTML::{"site_html_$template"} ? $Links::SiteHTML::{"site_html_$template"} : _compile ("site_html_$template");
defined $code or die "Invalid method: site_html_$template called.";

GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', "site_html_$template", $code, $vars, $opts);
}


replace the "or die...." with function call to

sub site_html_error

Where you can do things like check if the fail was with link data, or category data, or for personal pages, and display an error page.

Just make sure to check that you do not get into a recursive call. You might want to set a counter variable, to check that.

You could make the "or die..." a function call to another module, even, so on upgrades all you'd need to do is change that one phrase to the new function call.

That is the pre-fail condition if there is no hard-coded template routine, or a template on-disk.

It would be nice if Links had an error handler that allowed overriding specific error conditions, but all errors do not go through the Links::Error handler, such as the "die" condition, which is trapped, but not really handled.

Anyway, this specific "override" condition seems easy enough... it won't generalize to other error conditions, only the "template not found" condition.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Subject Author Views Date
Thread; hot thread page.cgi Bug Report - Fix Anyone? ryel01 3038 Jul 25, 2002, 2:55 AM
Thread; hot thread Re: [ryel01] page.cgi Bug Report - Fix Anyone?
yogi 2963 Jul 25, 2002, 3:03 AM
Thread; hot thread Re: [yogi] page.cgi Bug Report - Fix Anyone?
pugdog 2943 Jul 25, 2002, 4:38 AM
Thread; hot thread Re: [pugdog] page.cgi Bug Report - Fix Anyone?
yogi 2966 Jul 25, 2002, 4:42 AM
Thread; hot thread Re: [yogi] page.cgi Bug Report - Fix Anyone?
, 2965 Jul 25, 2002, 5:32 AM
Thread; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
Paul 2984 Jul 25, 2002, 5:34 AM
Post; hot thread Re: [Paul] page.cgi Bug Report - Fix Anyone?
, 2928 Jul 25, 2002, 6:22 AM
Thread; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
yogi 2946 Jul 25, 2002, 5:34 AM
Thread; hot thread Re: [yogi] page.cgi Bug Report - Fix Anyone?
, 2972 Jul 25, 2002, 6:21 AM
Post; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
pugdog 2944 Jul 25, 2002, 6:23 AM
Post; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
yogi 2959 Jul 25, 2002, 6:26 AM
Thread; hot thread Re: [pugdog] page.cgi Bug Report - Fix Anyone?
Paul 3000 Jul 25, 2002, 4:50 AM
Thread; hot thread Re: [Paul] page.cgi Bug Report - Fix Anyone?
pugdog 2980 Jul 25, 2002, 5:05 AM
Post; hot thread Re: [pugdog] page.cgi Bug Report - Fix Anyone?
Paul 2971 Jul 25, 2002, 5:07 AM