From b3a22576382995077f5cbcf5f425828d2e3b4616 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 Aug 2025 21:22:47 +0200 Subject: [PATCH] Fix : contract line activation error when duration not defined (#34813) * Fix : contract line activation error when duration not defined * Fix of fix * Update card.php --------- Co-authored-by: x Co-authored-by: Laurent Destailleur --- htdocs/contrat/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 6e5e32570f4..1656aed736b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1886,7 +1886,9 @@ if ($action == 'create') { if ($objp->fk_product > 0) { $product = new Product($db); $product->fetch($objp->fk_product); - $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + if (!empty($product->duration_value) && !empty($product->duration_unit)) { + $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + } } }