From 8416557e083a52aafadd08e192e43ada1ca2cfb1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 4 Jan 2025 10:43:01 +0100 Subject: [PATCH 1/3] FIX $this->origin_object can not be instance of CommandeFournisseur here --- htdocs/reception/class/reception.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index ea5794ed324..b85696b9cad 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -729,11 +729,7 @@ class Reception extends CommonObject $this->fetch_origin(); if ($this->origin_object instanceof CommonObject && empty($this->origin_object->lines)) { $res = $this->origin_object->fetch_lines(); - if ($this->origin_object instanceof CommandeFournisseur) { - $this->commandeFournisseur = $this->origin_object; // deprecated - } else { - $this->commandeFournisseur = null; // deprecated - } + $this->commandeFournisseur = null; // deprecated if ($res < 0) { return $res; } From 3e952e76946dd29649366aa58272b7e8a7825510 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 5 Jan 2025 17:47:24 +0100 Subject: [PATCH 2/3] FIX refactorize (maybe broken feature for not received completely) --- htdocs/reception/class/reception.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index b85696b9cad..8478ac2a85b 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -733,6 +733,12 @@ class Reception extends CommonObject if ($res < 0) { return $res; } + } elseif ($this->origin_object instanceof CommandeFournisseur && empty($this->origin_object->lines)) { + $res = $this->origin_object->fetch_lines(); + $this->commandeFournisseur = $this->origin_object; // deprecated + if ($res < 0) { + return $res; + } } } From b4848d90f6e0083ff8134eba8cccf894c0a58727 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Mon, 6 Jan 2025 17:14:50 +0100 Subject: [PATCH 3/3] Doc --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cca97eb20d4..b6d139108ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -441,7 +441,7 @@ WARNING: -------- The following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* If a filter is defined into and extrafields "Select from a table", this filter MUST use the Universai Search Filter syntax (field:=:value) instead of field=value. +* If a filter is defined into an extrafield, this filter MUST use the Universai Search Filter syntax (field:=:value) instead of th eunsecured SQL code field=value. See https://wiki.dolibarr.org/index.php?title=Universal_Search_Filter_Syntax * The parameter $filter of methods fetchAll() does not accept array of SQL commands but must be a string of an Universal Search Filter syntax. See https://wiki.dolibarr.org/index.php?title=Universal_Search_Filter_Syntax