Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions libraries/src/Menu/AbstractMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\User\User;
use Joomla\Registry\Registry;

/**
Expand Down Expand Up @@ -56,7 +57,7 @@ abstract class AbstractMenu
/**
* User object to check access levels for
*
* @var \JUser
* @var User
* @since 3.5
*/
protected $user;
Expand All @@ -81,7 +82,7 @@ public function __construct($options = array())
}
}

$this->user = isset($options['user']) && $options['user'] instanceof \JUser ? $options['user'] : Factory::getUser();
$this->user = isset($options['user']) && $options['user'] instanceof User ? $options['user'] : Factory::getUser();
}

/**
Expand Down
8 changes: 5 additions & 3 deletions libraries/src/Menu/SiteMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Cache\CacheControllerFactoryInterface;
use Joomla\CMS\Cache\Controller\CallbackController;
use Joomla\CMS\Cache\Exception\CacheExceptionInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Language;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\Database\DatabaseDriver;
use Joomla\Database\Exception\ExecutionFailureException;

/**
* Menu class
Expand Down Expand Up @@ -102,20 +104,20 @@ public function load()

$this->items = $cache->get($loader, array(), md5(get_class($this)), false);
}
catch (\JCacheException $e)
catch (CacheExceptionInterface $e)
{
try
{
$this->items = $loader();
}
catch (\JDatabaseExceptionExecuting $databaseException)
catch (ExecutionFailureException $databaseException)
{
$this->app->enqueueMessage(Text::sprintf('JERROR_LOADING_MENUS', $databaseException->getMessage()), 'warning');

return false;
}
}
catch (\JDatabaseExceptionExecuting $e)
catch (ExecutionFailureException $e)
{
$this->app->enqueueMessage(Text::sprintf('JERROR_LOADING_MENUS', $e->getMessage()), 'warning');

Expand Down