From 8ce184e061d1fa095e08053a4ed8ae37ca0ae3e1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 7 Dec 2012 03:38:21 -0800 Subject: [PATCH] Corrects some upgrade issues. (Issue #4) --- e107_admin/auth.php | 12 ++++++++++++ e107_handlers/mysql_class.php | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/e107_admin/auth.php b/e107_admin/auth.php index e8ba12a21..cb3561a7f 100644 --- a/e107_admin/auth.php +++ b/e107_admin/auth.php @@ -129,6 +129,18 @@ else // Fix - set cookie before login trigger session_set(e_COOKIE, $cookieval, (time() + 3600 * 24 * 30)); + // Required for a clean v1.x -> v2 upgrade. + $core = e107::getConfig('core'); + if($core->get('admintheme') != 'bootstrap') + { + $core->update('admintheme','bootstrap'); + $core->update('adminstyle','infopanel'); + $core->update('admincss','admin_style.css'); + $core->update('e_jslib_core',array('prototype' => 'none', 'jquery'=> 'auto')); + $core->save(); + } + // --- + e107::getEvent()->trigger("login", $edata_li); e107::getRedirect()->redirect(e_ADMIN_ABS.'admin.php'); //echo "\n"; diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index 0e9b44a53..a48d2fb87 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -1939,7 +1939,9 @@ class e_db_mysql $toSave = $array->WriteArray($outDefs, FALSE); // 2nd parameter to TRUE if needs to be written to DB if (FALSE === file_put_contents(e_CACHE_DB.$tableName.'.php', $toSave)) { // Could do something with error - but mustn't return FALSE - would trigger auto-generated structure - echo "Error writing file: ".e_CACHE_DB.$tableName.'.php'.'
'; + $mes = e107::getMessage(); + $mes->addDebug("Error writing file: ".e_CACHE_DB.$tableName.'.php'); //Fix for during v1.x -> 2.x upgrade. + // echo "Error writing file: ".e_CACHE_DB.$tableName.'.php'.'
'; } }