1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +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); $this->updatePlugin($func);
} }
// $dbv = e107::getSingleton('db_verify', e_HANDLER."db_verify_class.php");
// $dbv->clearCache();
$this->renderForm(); $this->renderForm();
} }
@@ -209,7 +213,7 @@ class e107Update
} }
else else
{ {
$mes->addDebug("could run 'update_".$func); $mes->addDebug("could not run 'update_".$func);
} }
//} //}
@@ -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 $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) if ($just_check)
{ {
@@ -549,6 +553,8 @@ function update_core_database($type = '')
$dbv->compileResults(); $dbv->compileResults();
$dbv->runFix(); // Fix entire core database structure and plugins too. $dbv->runFix(); // Fix entire core database structure and plugins too.
} }

View File

@@ -412,7 +412,9 @@ class db_verify
foreach($this->results as $tabs => $field) foreach($this->results as $tabs => $field)
{ {
$file = varset($this->results[$tabs]['_file']); $file = varset($this->results[$tabs]['_file']);
if(varset($this->errors[$tabs]['_status']) === 'missing_table') // Missing Table $errorStatus = !empty($this->errors[$tabs]['_status']) ? $this->errors[$tabs]['_status'] : null;
if($errorStatus === 'missing_table') // Missing Table
{ {
$this->fixList[$file][$tabs]['all'][] = 'create'; $this->fixList[$file][$tabs]['all'][] = 'create';
} }
@@ -421,7 +423,11 @@ class db_verify
foreach($field as $k=>$f) foreach($field as $k=>$f)
{ {
if($f['_status']=='ok') continue; 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,6 +726,7 @@ class db_verify
{ {
$id = $this->getId($this->sqlFileTables[$j]['tables'],$table); $id = $this->getId($this->sqlFileTables[$j]['tables'],$table);
$toFix = count($val);
foreach($val as $field=>$fixes) foreach($val as $field=>$fixes)
{ {
@@ -774,6 +781,7 @@ class db_verify
if(e107::getDb()->gen($query) !== false) if(e107::getDb()->gen($query) !== false)
{ {
$log->addDebug(LAN_UPDATED.' ['.$query.']'); $log->addDebug(LAN_UPDATED.' ['.$query.']');
$toFix--;
} }
else else
{ {
@@ -787,7 +795,13 @@ 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"); $log->flushMessages("Database Table(s) Modified");