Skip to content

Commit

Permalink
Catch exception so that Plugins+Themes listing page are still display…
Browse files Browse the repository at this point in the history
…ed even if server not connected to the internet. Fixes #4431

Thanks for the report!
  • Loading branch information
mattab committed Dec 26, 2013
1 parent 5fce035 commit 683b760
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions plugins/CorePluginsAdmin/Controller.php
Expand Up @@ -223,13 +223,17 @@ private function createPluginsOrThemesView($template, $themesOnly)
$view->pluginNamesHavingSettings = $this->getPluginNamesHavingSettingsForCurrentUser();
$view->isMarketplaceEnabled = CorePluginsAdmin::isMarketplaceEnabled();

$view->pluginsHavingUpdate = array();
$view->marketplacePluginNames = array();

if (CorePluginsAdmin::isMarketplaceEnabled()) {
$marketplace = new Marketplace();
$view->marketplacePluginNames = $marketplace->getAvailablePluginNames($themesOnly);
$view->pluginsHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly);
} else {
$view->pluginsHavingUpdate = array();
$view->marketplacePluginNames = array();
try {
$marketplace = new Marketplace();
$view->marketplacePluginNames = $marketplace->getAvailablePluginNames($themesOnly);
$view->pluginsHavingUpdate = $marketplace->getPluginsHavingUpdate($themesOnly);
} catch(Exception $e) {
// curl exec connection error (ie. server not connected to internet)
}
}

return $view;
Expand Down

0 comments on commit 683b760

Please sign in to comment.