1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-07 03:15:03 +02:00

Upgrade and Backward Compatibility Fixes.

This commit is contained in:
Cameron 2020-05-05 15:11:49 -07:00
parent 25f580ce2f
commit def50c174d
7 changed files with 64 additions and 10 deletions

View File

@ -111,6 +111,7 @@ class admin_start
private $exit = false; private $exit = false;
private $deprecated = array(); private $deprecated = array();
private $upgradeRequiredFirst = false;
function __construct() function __construct()
{ {
@ -120,6 +121,11 @@ class admin_start
return null; return null;
} }
if(!e107::getDb()->isTable('admin_log')) // Upgrade from v1.x to v2.x required.
{
$this->upgradeRequiredFirst = true;
}
// Files that can cause comflicts and problems. // Files that can cause comflicts and problems.
$fileInspector = e107::getFileInspector(); $fileInspector = e107::getFileInspector();
$this->deprecated = $fileInspector->insecureFiles; $this->deprecated = $fileInspector->insecureFiles;
@ -264,6 +270,13 @@ class admin_start
return null; return null;
} }
if($this->upgradeRequiredFirst)
{
$message = "<p><a class='btn btn-lg btn-primary alert-link' href='e107_update.php'>".LAN_CONTINUE." ".SEP."</a></p>";
e107::getMessage()->addInfo($message);
}
return null; return null;
@ -494,6 +507,11 @@ TMPO;
private function checkIncompatiblePlugins() private function checkIncompatiblePlugins()
{ {
if($this->upgradeRequiredFirst)
{
return null;
}
$mes = e107::getMessage(); $mes = e107::getMessage();
$installedPlugs = e107::getPref('plug_installed'); $installedPlugs = e107::getPref('plug_installed');
@ -523,6 +541,11 @@ TMPO;
private function checkPasswordEncryption() private function checkPasswordEncryption()
{ {
if($this->upgradeRequiredFirst)
{
return null;
}
$us = e107::getUserSession(); $us = e107::getUserSession();
$mes = e107::getMessage(); $mes = e107::getMessage();
@ -558,7 +581,10 @@ TMPO;
private function checkDeprecated() private function checkDeprecated()
{ {
if($this->upgradeRequiredFirst)
{
return null;
}
$found = array(); $found = array();
foreach($this->deprecated as $path) foreach($this->deprecated as $path)

View File

@ -363,18 +363,28 @@ e107::getJs()->renderJs('header_inline', 3);
echo "<!-- *META* -->\n"; echo "<!-- *META* -->\n";
// --- Load plugin Meta files and eplug_ before others -------- // --- Load plugin Meta files and eplug_ before others --------
if (vartrue($pref['e_meta_list']))
/** @var array $incompatibleMeta - plugins that may cause jQuery conflicts etc if loaded. */
$incompatibleMeta = array('aa_jquery', 'fancybox', 'lightwindow', 'e107slider' );
if (!empty($pref['e_meta_list']))
{ {
foreach ($pref['e_meta_list'] as $val) foreach ($pref['e_meta_list'] as $val)
{ {
if(in_array($val,$incompatibleMeta))
{
continue;
}
if (is_readable(e_PLUGIN.$val."/e_meta.php")) if (is_readable(e_PLUGIN.$val."/e_meta.php"))
{ {
echo "<!-- $val meta -->\n"; echo "\n\n<!-- $val meta -->\n";
require_once (e_PLUGIN.$val."/e_meta.php"); require_once (e_PLUGIN.$val."/e_meta.php");
} }
} }
} }
unset($incompatibleMeta);
if (!USER && ($pref['user_tracking'] == "session") && varset($pref['password_CHAP'],0)) if (!USER && ($pref['user_tracking'] == "session") && varset($pref['password_CHAP'],0))

View File

@ -125,11 +125,11 @@ if (!$dont_check_update)
// $dbupdate['218_to_219'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.8','2.1.9')), 'message'=> null, 'hide_when_complete'=>true); // $dbupdate['218_to_219'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.8','2.1.9')), 'message'=> null, 'hide_when_complete'=>true);
// $dbupdate['217_to_218'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.7','2.1.8')), 'message'=> null, 'hide_when_complete'=>true); // $dbupdate['217_to_218'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.7','2.1.8')), 'message'=> null, 'hide_when_complete'=>true);
$dbupdate['20x_to_220'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.x','2.2.0')), 'message'=> null, 'hide_when_complete'=>false);
$dbupdate['706_to_800'] = array('master'=>true, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('1.x','2.0')), 'message'=> LAN_UPDATE_29, 'hide_when_complete'=>true); $dbupdate['706_to_800'] = array('master'=>true, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('1.x','2.0')), 'message'=> LAN_UPDATE_29, 'hide_when_complete'=>true);
$dbupdate['20x_to_220'] = array('master'=>true, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.x','2.2.0')), 'message'=> null, 'hide_when_complete'=>false);
// always run these last. // always run these last.
$dbupdate['core_database'] = array('master'=>false, 'title'=> $LAN_UPDATE_5); $dbupdate['core_database'] = array('master'=>false, 'title'=> $LAN_UPDATE_5);

View File

@ -462,6 +462,7 @@ class e_array {
echo "<div class='alert alert-danger'><h4>e107::unserialize() Parser Error (json)</h4></div>"; echo "<div class='alert alert-danger'><h4>e107::unserialize() Parser Error (json)</h4></div>";
echo "<pre>"; echo "<pre>";
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
file_put_contents(e_LOG.'unserializeError_'.date('c').'.log', $ArrayData);
echo "</pre>"; echo "</pre>";
} }

View File

@ -100,7 +100,7 @@ class e_plugin
$this->_init(); $this->_init();
if(empty($this->_ids)) if(empty($this->_ids) )
{ {
// e107::getDebug()->log("Running e_plugin::_initIDs()"); // e107::getDebug()->log("Running e_plugin::_initIDs()");
// e107::getDebug()->log(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); // e107::getDebug()->log(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));
@ -581,7 +581,10 @@ class e_plugin
} }
if(e_PAGE == 'e107_update.php')
{
return null;
}
foreach($detected as $path) // add a missing plugin to the database table. foreach($detected as $path) // add a missing plugin to the database table.

View File

@ -471,6 +471,8 @@ function step5()
if ($sql -> select('forum')) if ($sql -> select('forum'))
{ {
$forumList = $sql -> db_getList(); $forumList = $sql -> db_getList();
$sefs = array();
foreach ($forumList as $forum) foreach ($forumList as $forum)
{ {
if ($forum['forum_parent'] == 0) if ($forum['forum_parent'] == 0)
@ -489,8 +491,16 @@ function step5()
$tmp = $forum; $tmp = $forum;
$tmp['forum_threadclass'] = $tmp['forum_postclass']; $tmp['forum_threadclass'] = $tmp['forum_postclass'];
$tmp['forum_options'] = '_NULL_'; $tmp['forum_options'] = '_NULL_';
$tmp['forum_sef'] = eHelper::title2sef($forum['forum_name'],'dashl'); $forum_sef = eHelper::title2sef($forum['forum_name'],'dashl');
if(isset($sefs[$forum_sef]))
{
$forum_sef .= "-2";
}
$tmp['forum_sef'] = $forum_sef;
$sefs[$forum_sef] = true;
// $tmp['_FIELD_TYPES'] = $ftypes['_FIELD_TYPES']; // $tmp['_FIELD_TYPES'] = $ftypes['_FIELD_TYPES'];
if ($sql -> insert('forum_new', $tmp)) if ($sql -> insert('forum_new', $tmp))
@ -499,7 +509,8 @@ function step5()
} }
else else
{ {
$mes -> addError("Insert failed on " . print_a($tmp, true)); $mes->addDebug("Insert failed on " . print_a($tmp, true));
$mes->addError($sql->getLastErrorText());
} }
} }

View File

@ -1,4 +1,7 @@
/* Backwards Compatibility Stylesheet for v1.x */ /* Backwards Compatibility Stylesheet for v1.x */
/* v1.x e107.css */
table { margin-left:auto; margin-right:auto; }
/* Bootstrap Alerts */ /* Bootstrap Alerts */
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; } .alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }