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 3485 Jul 25, 2002, 2:55 AM
Thread; hot thread Re: [ryel01] page.cgi Bug Report - Fix Anyone?
yogi 3411 Jul 25, 2002, 3:03 AM
Thread; hot thread Re: [yogi] page.cgi Bug Report - Fix Anyone?
pugdog 3387 Jul 25, 2002, 4:38 AM
Thread; hot thread Re: [pugdog] page.cgi Bug Report - Fix Anyone?
yogi 3426 Jul 25, 2002, 4:42 AM
Thread; hot thread Re: [yogi] page.cgi Bug Report - Fix Anyone?
, 3412 Jul 25, 2002, 5:32 AM
Thread; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
Paul 3459 Jul 25, 2002, 5:34 AM
Post; hot thread Re: [Paul] page.cgi Bug Report - Fix Anyone?
, 3373 Jul 25, 2002, 6:22 AM
Thread; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
yogi 3388 Jul 25, 2002, 5:34 AM
Thread; hot thread Re: [yogi] page.cgi Bug Report - Fix Anyone?
, 3418 Jul 25, 2002, 6:21 AM
Post; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
pugdog 3387 Jul 25, 2002, 6:23 AM
Post; hot thread Re: [TLA] page.cgi Bug Report - Fix Anyone?
yogi 3431 Jul 25, 2002, 6:26 AM
Thread; hot thread Re: [pugdog] page.cgi Bug Report - Fix Anyone?
Paul 3445 Jul 25, 2002, 4:50 AM
Thread; hot thread Re: [Paul] page.cgi Bug Report - Fix Anyone?
pugdog 3422 Jul 25, 2002, 5:05 AM
Post; hot thread Re: [pugdog] page.cgi Bug Report - Fix Anyone?
Paul 3416 Jul 25, 2002, 5:07 AM