mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/migrations] Catch and display errors from the migrator
PHPBB3-11318
This commit is contained in:
parent
fc4d5f74c0
commit
b398fa2050
3 changed files with 35 additions and 9 deletions
|
@ -7,7 +7,13 @@
|
|||
<p>{L_EXTENSIONS_EXPLAIN}</p>
|
||||
<p>{L_ENABLE_EXPLAIN}</p>
|
||||
|
||||
<!-- IF PRE -->
|
||||
<!-- IF MIGRATOR_ERROR -->
|
||||
<div class="errorbox">
|
||||
<p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
|
||||
<p>{MIGRATOR_ERROR}</p>
|
||||
<p><a href="{U_RETURN}">{L_RETURN}</a></p>
|
||||
</div>
|
||||
<!-- ELSEIF PRE -->
|
||||
<div class="errorbox">
|
||||
<p>{L_ENABLE_CONFIRM}</p>
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,13 @@
|
|||
<p>{L_EXTENSIONS_EXPLAIN}</p>
|
||||
<p>{L_PURGE_EXPLAIN}</p>
|
||||
|
||||
<!-- IF PRE -->
|
||||
<!-- IF MIGRATOR_ERROR -->
|
||||
<div class="errorbox">
|
||||
<p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
|
||||
<p>{MIGRATOR_ERROR}</p>
|
||||
<p><a href="{U_RETURN}">{L_RETURN}</a></p>
|
||||
</div>
|
||||
<!-- ELSEIF PRE -->
|
||||
<div class="errorbox">
|
||||
<p>{L_PURGE_CONFIRM}</p>
|
||||
</div>
|
||||
|
|
|
@ -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,12 +103,19 @@ class acp_extensions
|
|||
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
catch (phpbb_db_migration_exception $e)
|
||||
{
|
||||
$template->assign_var('MIGRATOR_ERROR', $user->lang($e->getMessage(), $e->getParameters()));
|
||||
}
|
||||
|
||||
$this->tpl_name = 'acp_ext_enable';
|
||||
|
||||
|
@ -156,12 +163,19 @@ class acp_extensions
|
|||
break;
|
||||
|
||||
case 'purge':
|
||||
try
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
catch (phpbb_db_migration_exception $e)
|
||||
{
|
||||
$template->assign_var('MIGRATOR_ERROR', $user->lang($e->getMessage(), $e->getParameters()));
|
||||
}
|
||||
|
||||
$this->tpl_name = 'acp_ext_purge';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue