diff options
| author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-02-09 21:09:29 -0600 |
|---|---|---|
| committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-02-09 21:09:29 -0600 |
| commit | b398fa2050ab720d9a3ae2b809bb3cdf4f153dc6 (patch) | |
| tree | cad687b63d5178c0c1724e1b25494c64d53bf006 /phpBB/includes/acp/acp_extensions.php | |
| parent | fc4d5f74c0b82989370e899939d6f31e9a85723d (diff) | |
| download | forums-b398fa2050ab720d9a3ae2b809bb3cdf4f153dc6.tar forums-b398fa2050ab720d9a3ae2b809bb3cdf4f153dc6.tar.gz forums-b398fa2050ab720d9a3ae2b809bb3cdf4f153dc6.tar.bz2 forums-b398fa2050ab720d9a3ae2b809bb3cdf4f153dc6.tar.xz forums-b398fa2050ab720d9a3ae2b809bb3cdf4f153dc6.zip | |
[feature/migrations] Catch and display errors from the migrator
PHPBB3-11318
Diffstat (limited to 'phpBB/includes/acp/acp_extensions.php')
| -rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index a0bcf62ecc..17ab4f3169 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -37,7 +37,7 @@ class acp_extensions $this->template = $template; $this->user = $user; - $user->add_lang(array('install', 'acp/extensions')); + $user->add_lang(array('install', 'acp/extensions', 'migrator')); $this->page_title = 'ACP_EXTENSIONS'; @@ -103,11 +103,18 @@ class acp_extensions trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action)); } - if ($phpbb_extension_manager->enable_step($ext_name)) + try { - $template->assign_var('S_NEXT_STEP', true); + if ($phpbb_extension_manager->enable_step($ext_name)) + { + $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name)); + } + } + catch (phpbb_db_migration_exception $e) + { + $template->assign_var('MIGRATOR_ERROR', $user->lang($e->getMessage(), $e->getParameters())); } $this->tpl_name = 'acp_ext_enable'; @@ -156,11 +163,18 @@ class acp_extensions break; case 'purge': - if ($phpbb_extension_manager->purge_step($ext_name)) + try { - $template->assign_var('S_NEXT_STEP', true); + if ($phpbb_extension_manager->purge_step($ext_name)) + { + $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name)); + } + } + catch (phpbb_db_migration_exception $e) + { + $template->assign_var('MIGRATOR_ERROR', $user->lang($e->getMessage(), $e->getParameters())); } $this->tpl_name = 'acp_ext_purge'; |
