FIX php8.1 warning

This commit is contained in:
Regis Houssin 2022-05-21 23:27:19 +02:00
parent 0f268b682a
commit 82e19879d5
2 changed files with 6 additions and 2 deletions

View File

@ -585,6 +585,10 @@ complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqls
$i = 0;
foreach ($tabcomplete as $key => $value) {
$i++;
// When a dictionnary is commented
if (!isset($tabcond[$i])) {
continue;
}
$tabcomplete[$key]['id'] = $i;
$tabcomplete[$key]['cond'] = $tabcond[$i];
$tabcomplete[$key]['rowid'] = $tabrowid[$i];
@ -607,7 +611,7 @@ if (empty($sortfield)) {
$tmp1 = explode(',', empty($tabcomplete[$keytable]['sqlsort']) ? '' : $tabcomplete[$keytable]['sqlsort']);
$tmp2 = explode(' ', $tmp1[0]);
$sortfield = preg_replace('/^.*\./', '', $tmp2[0]);
$sortorder = $tmp2[1];
$sortorder = (!empty($tmp2[1]) ? $tmp2[1] : '');
//var_dump($sortfield);var_dump($sortorder);
}

View File

@ -340,7 +340,7 @@ if ($result) {
$obj = $db->fetch_object($result);
// If line is for a module that does not exist anymore (absent of includes/module), we ignore it
if (empty($modules[$obj->module])) {
if (!isset($obj->module) || empty($modules[$obj->module])) {
$i++;
continue;
}