From e38e4532b3b669a16ec529b69f9c0583db6ac570 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Tue, 15 Oct 2013 08:50:38 +0200 Subject: [PATCH] fix update procedure for users who upgraded from syscp (the database field which is to be dropped does not exist for them, just in fresh installs), fixes #1278 Signed-off-by: Michael Kaufmann (d00p) --- install/updates/froxlor/0.9/update_0.9.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 3ff304cd..327f9007 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2238,9 +2238,15 @@ if (isFroxlorVersion('0.9.29.1-dev3')) { showUpdateStep("Updating from 0.9.29.1-dev3 to 0.9.29.1-dev4", true); lastStepStatus(0); - showUpdateStep("Removing old billing-field from admin-users"); - $db->query("ALTER TABLE `".TABLE_PANEL_ADMINS."` DROP `edit_billingdata`"); - lastStepStatus(0); + // If you upgraded from SysCP the edit_billingdata field has been + // removed in one of the first upgrades to froxlor. Sadly, one field + // remained in the install.sql so we remove it now if it exists + $bd_exists = $db->query("SHOW COLUMNS FROM `".TABLE_PANEL_ADMINS."` LIKE 'edit_billingdata';"); + if ($db->num_rows() > 0) { + showUpdateStep("Removing old billing-field from admin-users"); + $db->query("ALTER TABLE `".TABLE_PANEL_ADMINS."` DROP `edit_billingdata`"); + lastStepStatus(0); + } updateToVersion('0.9.29.1-dev4'); }