fix: result checks for PHP 8.1 (#26175)

This commit is contained in:
am97 2023-10-10 21:17:25 +02:00 committed by GitHub
parent 876f45e3fd
commit 8e8528368a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,7 +116,7 @@ if ($action == 'update') {
$sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".((int) GETPOST('rowid', 'int'));
$result = $db->query($sql);
if ($result > 0) {
if ($result) {
$db->commit();
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$action = "";
@ -154,7 +154,7 @@ if ($action == 'add') {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".((int) $conf->entity).")";
$result = $db->query($sql);
if ($result > 0) {
if ($result) {
$db->commit();
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$action = "";
@ -176,7 +176,7 @@ if ($action == 'add') {
if ($action == 'delete') {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."overwrite_trans WHERE rowid = ".((int) $id);
$result = $db->query($sql);
if ($result >= 0) {
if ($result) {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
} else {
dol_print_error($db);
@ -296,7 +296,7 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) {
$result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite
$result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
if ($result < 0) {
if (!$result) {
print 'Failed to load language file '.$tmpfile.'<br>'."\n";
} else {
$listoffiles[$langkey] = $tmpfile;