fixed not found page problem

This commit is contained in:
JT Smith 2005-08-02 18:53:34 +00:00
parent 5af6eaa085
commit 8dac9d9daa
3 changed files with 21 additions and 14 deletions

View file

@ -89,20 +89,24 @@ sub page {
my $output = _processOperations();
if ($output eq "") {
my $asset = WebGUI::Asset->newByUrl($assetUrl);
$session{asset} = $asset;
my $method = "view";
if (exists $session{form}{func}) {
$method = $session{form}{func};
}
$method = "www_".$method;
$output = eval{$asset->$method()};
if ($@) {
WebGUI::ErrorHandler::warn("Couldn't call method ".$method." on asset for ".$session{env}{PATH_INFO}." Root cause: ".$@);
$output = $asset->www_view;
} else {
if ($output eq "" && $method ne "view") {
$output = $asset->www_view;
if (defined $asset) {
$session{asset} = $asset;
my $method = "view";
if (exists $session{form}{func}) {
$method = $session{form}{func};
}
$method = "www_".$method;
$output = eval{$asset->$method()};
if ($@) {
WebGUI::ErrorHandler::warn("Couldn't call method ".$method." on asset for ".$session{env}{PATH_INFO}." Root cause: ".$@);
$output = $asset->www_view;
} else {
if ($output eq "" && $method ne "view") {
$output = $asset->www_view;
}
}
} else {
$output = WebGUI::Asset->getNotFound->www_view;
}
}
WebGUI::Affiliate::grabReferral(); # process affilliate tracking request

View file

@ -1056,7 +1056,8 @@ sub newByUrl {
if ($id ne "" || $class ne "") {
return WebGUI::Asset->new($id, $class, $version);
} else {
return WebGUI::Asset->getNotFound;
WebGUI::ErrorHandler::warn("The URL $url was requested, but does not exist in your asset tree.");
return undef;
}
}
return WebGUI::Asset->getDefault;