Permalink
Browse files

Fix a regression with controllers for specific formats.

  • Loading branch information...
1 parent a3a9975 commit dd7c846ae31df7f5e56853dbfbc9cd0b56e04251 @realityking committed Aug 29, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 libraries/joomla/application/component/controller.php
View
10 libraries/joomla/application/component/controller.php
@@ -270,8 +270,10 @@ public static function getInstance($prefix, $config = array())
$task = $command;
// Define the controller filename and path.
- $file = self::createFileName('controller', array('name' => 'controller', 'format' => $format));
- $path = $basePath . '/' . $file;
+ $file = self::createFileName('controller', array('name' => 'controller', 'format' => $format));
+ $path = $basePath . '/' . $file;
+ $backupfile = self::createFileName('controller', array('name' => 'controller'));
+ $backuppath = $basePath . '/' . $backupfile;
}
// Get the controller class name.
@@ -285,6 +287,10 @@ public static function getInstance($prefix, $config = array())
{
require_once $path;
}
+ elseif (isset($backuppath) && file_exists($backuppath))
+ {
+ require_once $backuppath;
+ }
else
{
throw new InvalidArgumentException(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER', $type, $format));

0 comments on commit dd7c846

Please sign in to comment.