From 05c426b3b8aa72c3a6112ea4ef9f2233d6c16fd4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 2 Apr 2011 20:03:40 +0200 Subject: [PATCH] Added code that was accidentaly removed --- root/includes/acp/acp_portal.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index 160e1793..d8ad8b5e 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -744,10 +744,30 @@ class acp_portal $module_id = $db->sql_nextid(); - $c_class->install($module_id); + $error = $c_class->install($module_id); $cache->purge(); // make sure we don't get errors after re-adding a module + // if something went wrong, handle the errors accordingly and undo the above query + if (sizeof($error)) + { + if (is_array($error)) + { + foreach($error as $cur_error) + { + $error_output = $cur_error . '
'; + } + } + else if($error != false) + { + $error_output = $error; + } + + $sql = 'DELETE FROM ' . PORTAL_MODULES_TABLE . ' WHERE module_id = ' . (int) $module_id; + + trigger_error($error_output . adm_back_link($this->u_action)); + } + meta_refresh(3, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=portal&mode=config&module_id=' . $module_id)); trigger_error($user->lang['SUCCESS_ADD'] . adm_back_link($this->u_action));