fix: result checks for PHP 8.1 (#26175)
This commit is contained in:
parent
876f45e3fd
commit
8e8528368a
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue