diff --git a/core/PluginsManager.php b/core/PluginsManager.php index 9f344aa9223b9cdf13ec1e88fb4a59cd7e8e1c7e..577a66bfdf500ed59b42313e55293282cd6042dd 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -121,6 +121,7 @@ class Piwik_PluginsManager // Delete merged js/css files to force regenerations to exclude the deactivated plugin Piwik_AssetManager::removeMergedAssets(); + Piwik_View::clearCompiledTemplates(); } public function installLoadedPlugins() @@ -160,7 +161,8 @@ class Piwik_PluginsManager Zend_Registry::get('config')->Plugins = $plugins; // Delete merged js/css files to force regenerations to include the activated plugin - Piwik_AssetManager::removeMergedAssets(); + Piwik_AssetManager::removeMergedAssets(); + Piwik_View::clearCompiledTemplates(); } public function loadPlugins( array $pluginsToLoad ) diff --git a/core/View.php b/core/View.php index 7ea936d7a173a75e593a2e0a0e6c1c55fc8d130f..443950d8512b0eb4775f9d015377ae9ebf76bb92 100644 --- a/core/View.php +++ b/core/View.php @@ -201,9 +201,10 @@ class Piwik_View implements Piwik_iView /** * Clear compiled Smarty templates */ - public function clearCompiledTemplates() + static public function clearCompiledTemplates() { - $this->smarty->clear_compiled_tpl(); + $view = Piwik_View::factory(); + $view->smarty->clear_compiled_tpl(); } /* @@ -215,8 +216,6 @@ class Piwik_View implements Piwik_iView } return false; } - - public function setCaching($caching) { $this->smarty->caching = $caching; @@ -271,7 +270,7 @@ class Piwik_View implements Piwik_iView * @param $templateName Template name (e.g., 'index') * @param $viewType View type (e.g., Piwik_View::CLI) */ - static public function factory( $templateName, $viewType = null) + static public function factory( $templateName = null, $viewType = null) { Piwik_PostEvent('View.getViewType', $viewType); @@ -320,12 +319,15 @@ class Piwik_View implements Piwik_iView if($viewType != self::MOBILE) { $templateFile = $path.'/templates/'.$templateName.'.tpl'; - if(!file_exists($templateFile)) - { - throw new Exception('Template not found: '.$templateFile); - } } - + + // Specified template not found + // We allow for no specified template + if(!empty($templateName) + && !file_exists($templateFile)) + { + throw new Exception('Template not found: '.$templateFile); + } return new Piwik_View($templateFile); } } diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php index 91e83ffd88c1c251811a79bdeada7af5d8d859bf..2952d40c3e1c74c05d7f1c26374911bd63d9d873 100644 --- a/plugins/CoreUpdater/Controller.php +++ b/plugins/CoreUpdater/Controller.php @@ -298,6 +298,7 @@ class Piwik_CoreUpdater_Controller extends Piwik_Controller { // Delete merged js/css files to force regenerations based on new versions of css/js files Piwik_AssetManager::removeMergedAssets(); + Piwik_View::clearCompiledTemplates(); $this->loadAndExecuteUpdateFiles($updater, $componentsWithUpdateFile); diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index a8eea9bd55f78460139b664b2bedab200882d8b2..ff2dde3eb169eedfb1f3b1a4475c003c1ae42c41 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -74,6 +74,7 @@ class Piwik_Installation_Controller extends Piwik_Controller { // Delete merged js/css files to force regenerations based on updated activated plugin list Piwik_AssetManager::removeMergedAssets(); + Piwik_View::clearCompiledTemplates(); $view = new Piwik_Installation_View( $this->pathView . 'welcome.tpl',