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:
@@ -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,9 +213,9 @@ class e107Update
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mes->addDebug("could run 'update_".$func);
|
$mes->addDebug("could not run 'update_".$func);
|
||||||
}
|
}
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -268,7 +272,7 @@ class e107Update
|
|||||||
|
|
||||||
$text = "";
|
$text = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($this->core as $func => $data)
|
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
|
$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.
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -411,8 +411,10 @@ 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,7 +726,8 @@ 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)
|
||||||
{
|
{
|
||||||
foreach($fixes as $mode)
|
foreach($fixes as $mode)
|
||||||
@@ -773,7 +780,8 @@ 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
|
||||||
{
|
{
|
||||||
@@ -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");
|
$log->flushMessages("Database Table(s) Modified");
|
||||||
|
Reference in New Issue
Block a user