From 547ed839d9e698a7e2ee2931dcfa4116301f28bc Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 1 Dec 2009 09:50:27 -0500 Subject: [PATCH] Correcting constructor of MediaView to fix issues with viewVars not being set. Correcting use of MediaView in Dispatcher. Fixes #366 --- cake/dispatcher.php | 3 ++- cake/libs/view/media.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index cb3d20287..999648d29 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -605,7 +605,8 @@ class Dispatcher extends Object { $this->_stop(); } App::import('View', 'Media', false); - $Media = new MediaView(); + $controller = null; + $Media = new MediaView($controller); $ext = array_pop(explode('.', $url)); if (isset($Media->mimeType[$ext])) { diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index d181fd8d9..085ba91da 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -17,7 +17,9 @@ * @since CakePHP(tm) v 1.2.0.5714 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -class MediaView { +App::import('View', 'View', false); + +class MediaView extends View { /** * Holds known mime type mappings @@ -90,7 +92,8 @@ class MediaView { * * @param object $controller */ - function __construct($controller = null) { + function __construct(&$controller = null) { + parent::__construct($controller); } /**