1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 13:11:52 +02:00

Database verification now runs again directly after applying fixes. Compatibility fix for core_functions.php

This commit is contained in:
Cameron 2018-11-22 13:43:02 -08:00
parent 6367074571
commit 5d27229183
3 changed files with 32 additions and 20 deletions

View File

@ -203,13 +203,15 @@ class system_tools
$this->del_pref_val($_POST['pref_type']);
}
if(isset($_POST['verify_sql']) || varset($_GET['mode'])=='verify_sql')
if(isset($_POST['verify_sql']) || !empty($_POST['verify_table']) || varset($_GET['mode']) =='verify_sql')
{
e107::getCache()->clear('Dbverify',true);
require_once(e_HANDLER."db_verify_class.php");
$dbv = new db_verify;
$dbv->backUrl = e_SELF."?mode=verify_sql";
$dbv->verify();
//echo e107::getMessage()->render();
return;
}

View File

@ -372,7 +372,7 @@ if (!function_exists('multiarray_sort'))
* @param $order
* @param $natsort
* @param $case
* @return sorted array.
* @return array sorted array.
*/
function multiarray_sort(&$array, $key, $order = 'asc', $natsort = true, $case = true)
{
@ -397,15 +397,21 @@ if (!function_exists('multiarray_sort'))
if(!isset($sort_values))
{
return;
return $array;
}
reset ($sort_values);
/*
while (list ($arr_key, $arr_val) = each ($sort_values))
{
$key = is_numeric($arr_key) ? "" : $arr_key; // retain assoc-array keys.
$sorted_arr[$key] = $array[$arr_key];
}*/
foreach($sort_values as $arr_key=>$arr_val)
{
$key = is_numeric($arr_key) ? "" : $arr_key; // retain assoc-array keys.
$sorted_arr[$key] = $array[$arr_key];
}
return $sorted_arr;
}

View File

@ -162,21 +162,18 @@ class db_verify
*/
function verify()
{
if(!empty($_POST['runfix']))
{
$this->runFix($_POST['fix']);
}
if(!empty($_POST['verify_table']))
{
$this->runComparison($_POST['verify_table']);
}
else
{
if(isset($_POST['runfix']))
{
$this->runFix($_POST['fix']);
}
$this->renderTableSelect();
$this->renderTableSelect();
}
}
@ -199,7 +196,7 @@ class db_verify
{
$message = str_replace("[x]",$cnt,DBVLAN_26); // Found [x] issues.
$mes->add($message, E_MESSAGE_WARNING);
$this->renderResults();
$this->renderResults($fileArray);
}
else
{
@ -456,8 +453,8 @@ class db_verify
}
function renderResults()
function renderResults($fileArray=array())
{
$frm = e107::getForm();
@ -466,8 +463,8 @@ class db_verify
$text = "
<form method='post' action='".e_SELF."?".e_QUERY."'>
<fieldset id='core-db-verify-{$selection}'>
<legend id='core-db-verify-{$selection}-legend'>".DBVLAN_16."</legend>
<fieldset id='core-db-verify-results'>
<legend id='core-db-verify-results-legend'>".DBVLAN_16."</legend>
<table class='table adminlist'>
<colgroup>
@ -479,7 +476,7 @@ class db_verify
</colgroup>
<thead>
<tr>
<th>".DBVLAN_4.": {$k}</th>
<th>".DBVLAN_4."</th>
<th>".DBVLAN_5."</th>
<th class='center'>".DBVLAN_6."</th>
<th>".DBVLAN_7."</th>
@ -577,7 +574,14 @@ class db_verify
<div class='buttons-bar right'>
".$frm->admin_button('runfix', DBVLAN_21, 'execute', '', array('id'=>false))."
".$frm->admin_button('check_all', 'jstarget:fix', 'action', LAN_CHECKALL, array('id'=>false))."
".$frm->admin_button('uncheck_all', 'jstarget:fix', 'action', LAN_UNCHECKALL, array('id'=>false))."
".$frm->admin_button('uncheck_all', 'jstarget:fix', 'action', LAN_UNCHECKALL, array('id'=>false));
foreach($fileArray as $tab)
{
$text .= $frm->hidden('verify_table[]',$tab);
}
$text .= "
</div>
</fieldset>