From 98bee3e50fa4ad509f13c37d6b1b376185445045 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 15 May 2008 08:44:37 +0000 Subject: [PATCH] BUGFIX: Make ModelAsController 404 result more testable git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@54635 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/ModelAsController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/control/ModelAsController.php b/core/control/ModelAsController.php index 40237084b..4a5f64c1c 100644 --- a/core/control/ModelAsController.php +++ b/core/control/ModelAsController.php @@ -19,7 +19,11 @@ class ModelAsController extends Controller implements NestedController { $this->init(); $nested = $this->getNestedController(); - $result = $nested->run($requestParams); + if(is_object($nested)) { + $result = $nested->run($requestParams); + } else { + $result = $nested; + } $this->popCurrent(); return $result; @@ -61,7 +65,7 @@ class ModelAsController extends Controller implements NestedController { return $controller; } else { - die("The requested page couldn't be found."); + return "The requested page couldn't be found."; } } else {