1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Issue #1936 Fix for the 'stuck' database update button on core update page. Temporarily modify core_sql.php to test.

This commit is contained in:
Cameron
2017-11-15 14:48:12 -08:00
parent cdc66797f3
commit af959b0c00
2 changed files with 31 additions and 11 deletions

View File

@@ -167,6 +167,10 @@ class e107Update
$this->updatePlugin($func);
}
// $dbv = e107::getSingleton('db_verify', e_HANDLER."db_verify_class.php");
// $dbv->clearCache();
$this->renderForm();
}
@@ -209,9 +213,9 @@ class e107Update
}
else
{
$mes->addDebug("could run 'update_".$func);
$mes->addDebug("could not run 'update_".$func);
}
//}
}
@@ -268,7 +272,7 @@ class e107Update
$text = "";
foreach($this->core as $func => $data)
{
@@ -536,7 +540,7 @@ function update_core_database($type = '')
$dbv->compareAll($exclude); // core & plugins, but not plugins calling for an update with xxxxx_setup.php
if(count($dbv->errors))
if($dbv->errors())
{
if ($just_check)
{
@@ -549,6 +553,8 @@ function update_core_database($type = '')
$dbv->compileResults();
$dbv->runFix(); // Fix entire core database structure and plugins too.
}

View File

@@ -411,8 +411,10 @@ class db_verify
{
foreach($this->results as $tabs => $field)
{
$file = varset($this->results[$tabs]['_file']);
if(varset($this->errors[$tabs]['_status']) === 'missing_table') // Missing Table
$file = varset($this->results[$tabs]['_file']);
$errorStatus = !empty($this->errors[$tabs]['_status']) ? $this->errors[$tabs]['_status'] : null;
if($errorStatus === 'missing_table') // Missing Table
{
$this->fixList[$file][$tabs]['all'][] = 'create';
}
@@ -421,7 +423,11 @@ class db_verify
foreach($field as $k=>$f)
{
if($f['_status']=='ok') continue;
$this->fixList[$f['_file']][$tabs][$k][] = $this->modes[$f['_status']];
$status = $f['_status'];
if(!empty($this->modes[$status]))
{
$this->fixList[$f['_file']][$tabs][$k][] = $this->modes[$status];
}
}
}
}
@@ -720,7 +726,8 @@ class db_verify
{
$id = $this->getId($this->sqlFileTables[$j]['tables'],$table);
$toFix = count($val);
foreach($val as $field=>$fixes)
{
foreach($fixes as $mode)
@@ -773,7 +780,8 @@ class db_verify
if(e107::getDb()->gen($query) !== false)
{
$log->addDebug(LAN_UPDATED.' ['.$query.']');
$log->addDebug(LAN_UPDATED.' ['.$query.']');
$toFix--;
}
else
{
@@ -786,8 +794,14 @@ class db_verify
}
}
}
} //
if(empty($toFix))
{
unset($this->errors[$table], $this->fixList[$j][$table]); // remove from error list since we are using a singleton
}
} //
}
$log->flushMessages("Database Table(s) Modified");