Skip to content

Commit

Permalink
Merge pull request #32251 from ATM-Consulting/FIX/130/coeur/fetch-ret…
Browse files Browse the repository at this point in the history
…urn-value-bad-test

Fix 17.0 missing test of return value
  • Loading branch information
eldy authored Dec 5, 2024
2 parents addefdf + 15c19b9 commit 42368b3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions htdocs/compta/facture/card-rec.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@
$object = new FactureRec($db);
if (($id > 0 || $ref) && $action != 'create' && $action != 'add') {
$ret = $object->fetch($id, $ref);
if (!$ret) {
if ($ret < 0) {
dol_print_error($db, $object->error, $object->errors);
exit;
} elseif (! $ret) {
setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
}
}
Expand Down Expand Up @@ -1175,6 +1178,7 @@
if ($object->id > 0) {
$object->fetch_thirdparty();

$formconfirm = '';
// Confirmation de la suppression d'une ligne produit
if ($action == 'ask_deleteline') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
Expand Down Expand Up @@ -1299,14 +1303,10 @@
}
print '</tr></table>';
print '</td><td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE) {
if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
}
if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else {
print '&nbsp;';
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
}
print '</td></tr>';

Expand Down Expand Up @@ -1729,6 +1729,7 @@
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$morehtmlcenter = '';
$somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);

print '</div>';
Expand Down

0 comments on commit 42368b3

Please sign in to comment.