From c404b0702e81aabda19e45e9a90f9a664acfdd01 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Sun, 16 Feb 2025 15:41:23 +0100 Subject: [PATCH 01/10] Prepare 20.0.5 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 4e38fe07568..388e1d7b5c5 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -35,7 +35,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '20.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '20.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 66b767d024cc35ed906ab98a38bee42ebd81d50e Mon Sep 17 00:00:00 2001 From: iLLixM <162678117+iLLixM@users.noreply.github.com> Date: Sun, 16 Feb 2025 18:22:33 +0100 Subject: [PATCH 02/10] Typo in Update ChangeLog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 823aa8cb42f..87f353f6cd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 20.0.4 compared to 20.0.2 ***** +***** ChangeLog for 20.0.4 compared to 20.0.3 ***** FIX: $this->origin_object can not be instance of CommandeFournisseur if it is already an instanceof CommonObject FIX: 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237 FIX: 17.0 - collisions in cache for dol_getIdFromCode From 730c6971da1a8adaf8ded6e8322abb5a7edddf7b Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 14:20:40 +0100 Subject: [PATCH 03/10] Debug v21 --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0a83062a908..b3880b31f81 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4774,7 +4774,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution'); } else { //img_help(($tooltiptrigger != '' ? 2 : 1), $alt) - print $form->textwithpicto($langs->trans("PreviewPageContent").' '.img_help(2, $langs->trans("PreviewPageContent")), $htmltext, 1, 'none', 'inline-block', 1, 2, 'tooltipsubstitution'); + print $form->textwithpicto($showlinktolayout ? '' : ($langs->trans("PreviewPageContent").' '.img_help(2, $langs->trans("PreviewPageContent"))), $htmltext, 1, 'none', 'inline-block', 1, 2, 'tooltipsubstitution'); } } print ''; From 180013b1ed8d9c99da04285d1c590359b2341352 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 14:53:44 +0100 Subject: [PATCH 04/10] Debug v21 --- htdocs/main.inc.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 110780d1401..7ab727033ba 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -736,15 +736,20 @@ if (!empty($_SESSION["disablemodules"])) { foreach ($disabled_modules as $module) { if ($module) { if (empty($conf->$module)) { - $conf->$module = new stdClass(); // To avoid warnings + $conf->$module = new stdClass(); // To avoid warnings } - $conf->$module->enabled = false; + + $conf->$module->enabled = false; // Old usage + unset($conf->modules[$module]); + foreach ($modulepartkeys as $modulepartkey) { unset($conf->modules_parts[$modulepartkey][$module]); } if ($module == 'fournisseur') { // Special case - $conf->supplier_order->enabled = 0; - $conf->supplier_invoice->enabled = 0; + $conf->supplier_order->enabled = 0; // Old usage + $conf->supplier_invoice->enabled = 0; // Old usage + unset($conf->modules['supplier_order']); + unset($conf->modules['supplier_invoice']); } } } From 1904d4da6e6918857d789ca5b11dc4168f55c86c Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 16:42:11 +0100 Subject: [PATCH 05/10] FIX harmless PHP warnings --- htdocs/compta/bank/class/paymentvarious.class.php | 3 ++- htdocs/compta/bank/various_payment/document.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index c42bc942479..1a2bfe8076e 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -767,7 +767,7 @@ class PaymentVarious extends CommonObject */ public function info($id) { - $sql = 'SELECT v.rowid, v.datec, v.fk_user_author'; + $sql = 'SELECT v.rowid, v.datec, v.fk_user_author, fk_user_modif, tms'; $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_various as v'; $sql .= ' WHERE v.rowid = '.((int) $id); @@ -780,6 +780,7 @@ class PaymentVarious extends CommonObject $this->id = $obj->rowid; $this->user_creation = $obj->fk_user_author; + $this->user_creation_id = $obj->fk_user_author; $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->tms); diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 7c717d7ede0..3ee2fbd77e9 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -129,7 +129,7 @@ if ($object->id) { $morehtmlref .= ''; $linkback = ''.$langs->trans("BackToList").''; - $morehtmlstatus = $morehtmlright; + $morehtmlstatus = ''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus); print '
'; From 612f34f719dfcdf494efeb1e6cd7e39b9bea8eb6 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 17 Feb 2025 15:09:31 +0100 Subject: [PATCH 06/10] FIX #33101 white page on ticket card when adding a link by reference --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5365b05435e..9a1299478d8 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -766,7 +766,7 @@ if ($action == 'create' || $action == 'presend') { $formticket->showForm(0, 'edit', 0, null, $action, $object); print dol_get_fiche_end(); -} elseif (empty($action) || in_array($action, ['builddoc', 'view', 'addlink', 'dellink', 'presend', 'presend_addmessage', 'close', 'abandon', 'delete', 'editcustomer', 'progression', 'categories', 'reopen', 'edit_contrat', 'editsubject', 'edit_extras', 'update_extras', 'edit_extrafields', 'set_extrafields', 'classify', 'sel_contract', 'edit_message_init', 'set_status', 'dellink'])) { +} elseif (empty($action) || in_array($action, ['builddoc', 'view', 'addlink', 'addlinkbyref', 'dellink', 'presend', 'presend_addmessage', 'close', 'abandon', 'delete', 'editcustomer', 'progression', 'categories', 'reopen', 'edit_contrat', 'editsubject', 'edit_extras', 'update_extras', 'edit_extrafields', 'set_extrafields', 'classify', 'sel_contract', 'edit_message_init', 'set_status'])) { if (!empty($res) && $res > 0) { // or for unauthorized internals users if (!$user->socid && (getDolGlobalString('TICKET_LIMIT_VIEW_ASSIGNED_ONLY') && $object->fk_user_assign != $user->id) && !$user->hasRight('ticket', 'manage')) { From 54e52c38328a5b17384ad9178e61e0f7997134af Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 21:49:08 +0100 Subject: [PATCH 07/10] Fix phpstan pb --- phpstan.neon.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a21273cea08..91d20f78748 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -21,6 +21,7 @@ parameters: analyseAndScan: - htdocs/custom/* - htdocs/documents/* + - htdocs/install/* # We must exclude this dir to avoid to have DOL_DOCUMENT_ROOT defined to .. by inc.php before the bootstrap*.php file can load it. - htdocs/install/doctemplates/* - htdocs/langs/* - htdocs/modulebuilder/template/test/* From 58e243e5355698980b6ee3bd0d386969a740e5d6 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 22:02:14 +0100 Subject: [PATCH 08/10] Fix phpstan --- htdocs/core/lib/geturl.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index bc105b30330..20d22d47b7c 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -52,7 +52,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = dol_syslog("getURLContent postorget=".$postorget." URL=".$url." param=".$param); if (!function_exists('curl_init')) { - return array('curl_error_no' => 'PHP curl lib not available', 'curl_error_msg' => 'PHP curl library must be installed'); + return array('http_code' => 500, 'content' => '', 'curl_error_no' => 1, 'curl_error_msg' => 'PHP curl library must be installed'); } //setting the curl parameters. From 104f5a9dc82815e93a6dca63fe30de970a582062 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 17 Feb 2025 22:02:14 +0100 Subject: [PATCH 09/10] Fix phpstan From 9d61b20ecd6f8cb3aab178f70b5f4e466af69d2a Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 18 Feb 2025 10:24:00 +0100 Subject: [PATCH 10/10] Fix php stan --- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/core/lib/company.lib.php | 18 ++++++++---------- htdocs/website/index.php | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b18bcac8aca..ec83f271881 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -119,7 +119,7 @@ class Commande extends CommonOrder /** * Status of the order - * @var int + * @var int|null */ public $status; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 494d9cff49c..7e89a2a2217 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -104,7 +104,7 @@ class Facture extends CommonInvoice protected $table_ref_field = 'ref'; /** - * @var int ID + * @var int|null ID * @deprecated Use $user_creation_id */ public $fk_user_author; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index fdd8dd83bcd..e5f10fb3c8b 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -184,7 +184,7 @@ class TimeSpent extends CommonObject */ public $intervention_line_id; /** - * @var string + * @var int */ public $datec; /** diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index eb1b72a3846..c91193ac55e 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2037,7 +2037,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr // Complete request and execute it with limit $sql .= $db->order($sortfield_new, $sortorder); - if ($limit) { + if ($limit) { // @phpstan-ignore-line $sql .= $db->plimit($limit + 1, $offset); } @@ -2684,16 +2684,14 @@ function htmlPrintOnlineHeader($mysoc, $langs) print '
'; // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; + print '
'; + print '
'; + print ''; + print '
'; + if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { + print ''; } + print '
'; if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { print '
'; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index b3880b31f81..5e376b7dafe 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4442,7 +4442,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties $pagelang = GETPOST('WEBSITE_LANG', 'aZ09'); } if (GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09')) { - $pageallowedinframes = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0; + $pageallowedinframes = 1; } if (GETPOST('htmlheader', 'none')) { // Must accept tags like '