1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +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']); $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); e107::getCache()->clear('Dbverify',true);
require_once(e_HANDLER."db_verify_class.php"); require_once(e_HANDLER."db_verify_class.php");
$dbv = new db_verify; $dbv = new db_verify;
$dbv->backUrl = e_SELF."?mode=verify_sql"; $dbv->backUrl = e_SELF."?mode=verify_sql";
$dbv->verify(); $dbv->verify();
//echo e107::getMessage()->render();
return; return;
} }

View File

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

View File

@@ -162,20 +162,17 @@ class db_verify
*/ */
function verify() function verify()
{ {
if(!empty($_POST['runfix']))
{
$this->runFix($_POST['fix']);
}
if(!empty($_POST['verify_table'])) if(!empty($_POST['verify_table']))
{ {
$this->runComparison($_POST['verify_table']); $this->runComparison($_POST['verify_table']);
} }
else 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. $message = str_replace("[x]",$cnt,DBVLAN_26); // Found [x] issues.
$mes->add($message, E_MESSAGE_WARNING); $mes->add($message, E_MESSAGE_WARNING);
$this->renderResults(); $this->renderResults($fileArray);
} }
else else
{ {
@@ -457,7 +454,7 @@ class db_verify
function renderResults() function renderResults($fileArray=array())
{ {
$frm = e107::getForm(); $frm = e107::getForm();
@@ -466,8 +463,8 @@ class db_verify
$text = " $text = "
<form method='post' action='".e_SELF."?".e_QUERY."'> <form method='post' action='".e_SELF."?".e_QUERY."'>
<fieldset id='core-db-verify-{$selection}'> <fieldset id='core-db-verify-results'>
<legend id='core-db-verify-{$selection}-legend'>".DBVLAN_16."</legend> <legend id='core-db-verify-results-legend'>".DBVLAN_16."</legend>
<table class='table adminlist'> <table class='table adminlist'>
<colgroup> <colgroup>
@@ -479,7 +476,7 @@ class db_verify
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th>".DBVLAN_4.": {$k}</th> <th>".DBVLAN_4."</th>
<th>".DBVLAN_5."</th> <th>".DBVLAN_5."</th>
<th class='center'>".DBVLAN_6."</th> <th class='center'>".DBVLAN_6."</th>
<th>".DBVLAN_7."</th> <th>".DBVLAN_7."</th>
@@ -577,7 +574,14 @@ class db_verify
<div class='buttons-bar right'> <div class='buttons-bar right'>
".$frm->admin_button('runfix', DBVLAN_21, 'execute', '', array('id'=>false))." ".$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('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> </div>
</fieldset> </fieldset>