Skip to content

Commit

Permalink
Corrects some upgrade issues. (Issue #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Dec 7, 2012
1 parent 845a79b commit 8ce184e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions e107_admin/auth.php
Expand Up @@ -129,6 +129,18 @@
// 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 "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
Expand Down
4 changes: 3 additions & 1 deletion e107_handlers/mysql_class.php
Expand Up @@ -1939,7 +1939,9 @@ protected function makeTableDef($tableName)
$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'.'<br />';
$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'.'<br />';
}
}

Expand Down

0 comments on commit 8ce184e

Please sign in to comment.