From 1867e6503a819d4a199d61d46c139f53f6d5595d Mon Sep 17 00:00:00 2001 From: phpnut Date: Mon, 2 Jan 2006 21:58:12 +0000 Subject: [PATCH] Merging revisions: Revision: [1700] Fixed loadController() to return true if the controller is already loaded. Fixed validation errors messages that where not showing. Revision: [1699] Fixed missingView error git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1701 3807eeeb-6ff5-0310-8944-8be069107fe0 --- VERSION.txt | 2 +- cake/basics.php | 4 ++++ cake/libs/controller/controller.php | 7 +++++-- cake/libs/view/view.php | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 231a98f0e..7dbc5cdd1 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -0.10.4.1697_beta \ No newline at end of file +0.10.4.1701_beta \ No newline at end of file diff --git a/cake/basics.php b/cake/basics.php index e2d97fefd..624c9cb36 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -169,6 +169,10 @@ function loadController ($name) } return file_exists($controller_fn)? require_once($controller_fn): false; } + else + { + return true; + } } /** diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index d12b9488e..cc5856d4c 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -348,7 +348,10 @@ class Controller extends Object function validateErrors () { $objects = func_get_args(); - if (!count($objects)) return false; + if (!count($objects)) + { + return false; + } $errors = array(); foreach ($objects as $object) @@ -383,7 +386,7 @@ class Controller extends Object { if(!empty($this->{$model}->validationErrors)) { - $view->validationErrors[$model] =& $this->{$model}->validationErrors; + $this->_viewClass->validationErrors[$model] =& $this->{$model}->validationErrors; } } } diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 326bc8871..f8b8df25f 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -307,7 +307,7 @@ class View extends Object $controller = $this; $controller->missingView = $viewFileName; $controller->action = $action; - call_user_func_array(array('View', 'missingView'), empty($params['pass'])? null: $params['pass']); + call_user_func_array(array(&$controller, 'missingView'), empty($params['pass'])? null: $params['pass']); $isFatal = isset($this->isFatal) ? $this->isFatal : false; if (!$isFatal) {