From aa33f7c15500fe7d35323b3d737853954a4d68ba Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Thu, 29 Jan 2026 22:55:02 +0100 Subject: [PATCH 1/2] Fix duplicate button for delivery reciept creation on shipment object (#36914) Co-authored-by: Lucas Marcouiller --- htdocs/expedition/card.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 233f9f86fa6..c6eea93b1b1 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -3072,12 +3072,6 @@ if ($action == 'create') { } } - // This is just to generate a delivery receipt - //var_dump($object->linkedObjectsIds['delivery']); - if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && ($object->status == Expedition::STATUS_VALIDATED || $object->status == Expedition::STATUS_CLOSED) && $user->hasRight('expedition', 'delivery', 'creer') && empty($object->linkedObjectsIds['delivery'])) { - print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"].'?action=create_delivery&token='.newToken().'&id='.$object->id, ''); - } - // Set Billed and Closed if ($object->status == Expedition::STATUS_VALIDATED) { if ($user->hasRight('expedition', 'creer') && $object->status > 0) { From 6b73bb78a4c02ea9d73e1a5bd4199a22d8339b9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Jan 2026 13:21:27 +0100 Subject: [PATCH 2/2] CI --- htdocs/core/lib/functions.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 04403f1cf46..5819c914b67 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2035,10 +2035,10 @@ function dolSlugify($stringtoslugify) /** * Returns text escaped for inclusion into javascript code * - * @param string $stringtoescape String to escape - * @param int<0,3> $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \ - * @param int $noescapebackslashn 0=Escape also \n. 1=Do not escape \n. - * @return string Escaped string. Both ' and " are escaped into ' if they are escaped. + * @param int|string $stringtoescape String to escape + * @param int<0,3> $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \ + * @param int $noescapebackslashn 0=Escape also \n. 1=Do not escape \n. + * @return string Escaped string. Both ' and " are escaped into ' if they are escaped. */ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0) { @@ -2064,7 +2064,7 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0) $substitjs["'"] = "\\'"; $substitjs['"'] = "\\\""; } - return strtr($stringtoescape, $substitjs); + return strtr((string) $stringtoescape, $substitjs); } /**