From b7638212079225bb1eccef4590ad29cf21df8fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= <121813548+altairis-benjamin@users.noreply.github.com> Date: Tue, 21 May 2024 17:52:22 +0200 Subject: [PATCH] FIX: unitialised var (#29728) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FIX: unitialised var is never initialised if reshook) for tabContentCreateOrder * Update card.php Changed initialisation value --------- Co-authored-by: Benjamin Falière --- htdocs/commande/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 01b5f8b7813..2975115fb92 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -14,7 +14,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2022 Gauthier VERDOL - * Copyright (C) 2023 Benjamin Falière + * Copyright (C) 2023-2024 Benjamin Falière * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2878,8 +2878,6 @@ if ($action == 'create' && $usercancreate) { $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); } - $numlines = count($object->lines); - /* * Form to add new line */ @@ -2919,6 +2917,8 @@ if ($action == 'create' && $usercancreate) { // Note that $action and $object may be modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); if (empty($reshook)) { + $numlines = count($object->lines); + // Reopen a closed order if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) { print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');