From 49b8f4a5904525e9a91b7791d9d1d89c3fc4cfda Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Tue, 14 Oct 2025 21:41:51 +0200 Subject: [PATCH 1/3] Fix: 3 modules where list.php redirected to /mymodule/myobject_card.php (#35732) * Fix: 3 modules where list.php redirected to /mymodule/myobject_card.php * remove an commented segment of the code which did the same kind of dolbuildpath to /mymodule/myobject_card.php which is obviously wrong, since it was a comment anyway, no risk * remove an commented line of the code which did the same kind of dolbuildpath to /mymodule/myobject_card.php which is obviously wrong, since it was a comment anyway, no risk --------- Co-authored-by: Jon Bendtsen --- htdocs/comm/mailing/list.php | 2 +- htdocs/don/list.php | 2 +- htdocs/loan/list.php | 2 +- htdocs/reception/card.php | 14 -------------- htdocs/ticket/class/cticketcategory.class.php | 1 - 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 0d59a52fc09..e0f4685788c 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -265,7 +265,7 @@ $num = $db->num_rows($resql); if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id); + header("Location: ".dol_buildpath('/comm/mailing/card.php', 1).'?id='.((int) $id)); exit; } diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 7b2e0b2688a..c7dcd56bc97 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -319,7 +319,7 @@ $num = $db->num_rows($resql); if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((int) $id)); + header("Location: ".dol_buildpath('/don/card.php', 1).'?id='.((int) $id)); exit; } diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 217dea0a3a9..73db57fdfe2 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -222,7 +222,7 @@ $num = $db->num_rows($resql); if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((int) $id)); + header("Location: ".dol_buildpath('/loan/card.php', 1).'?id='.((int) $id)); exit; } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 35e8be79b22..f71c3865656 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -198,20 +198,6 @@ if ($reshook < 0) { } if (empty($reshook)) { - /* - $backurlforlist = DOL_URL_ROOT.'/reception/list.php'; - - if (empty($backtopage) || ($cancel && empty($id))) { - if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { - if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { - $backtopage = $backurlforlist; - } else { - $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); - } - } - } - */ - if ($cancel) { if (!empty($backtopageforcancel)) { header("Location: ".$backtopageforcancel); diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 298f29764b0..a4cb0bd222f 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -480,7 +480,6 @@ class CTicketCategory extends CommonObject */ $label = ''; - //$url = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$this->id; $url = ''; if ($option != 'nolink') { From 58f516ef187b39ca1b8bb4c23cb0af07002d118a Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Tue, 14 Oct 2025 21:49:03 +0200 Subject: [PATCH 2/3] api_products purchase_prices: Adjust RestException with missing numbers (#35749) Co-authored-by: Jon Bendtsen Co-authored-by: Laurent Destailleur --- htdocs/product/class/api_products.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 9445f517bf3..b99e38cd445 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -900,7 +900,8 @@ class Products extends DolibarrApi * @return int * * @throws RestException 500 System error - * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 403 * * @url POST {id}/purchase_prices */ From aa67ad50bc79831d7c0b8fcf1ae109c3c067712c Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Tue, 14 Oct 2025 21:50:34 +0200 Subject: [PATCH 3/3] Mass mailing list: make title a clickable link (#35746) * Mass mailing list: make title a clickable link * Update list.php --------- Co-authored-by: Jon Bendtsen Co-authored-by: Laurent Destailleur --- htdocs/comm/mailing/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index e0f4685788c..1986ef75b48 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -538,7 +538,8 @@ while ($i < $imaxinloop) { } // Title - print ''.dol_escape_htmltag($obj->title).''; + print ''.dol_escape_htmltag($obj->title).''; + // Date creation print '';