From a6c11e27b1003c91ad06b25aaa03f4dfe01e1adb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Jan 2026 16:46:14 +0100 Subject: [PATCH] Fix CI --- htdocs/api/class/api_documents.class.php | 6 +++--- htdocs/commande/class/api_orders.class.php | 4 ++-- htdocs/compta/facture/class/api_invoices.class.php | 8 ++++---- htdocs/mrp/class/api_mos.class.php | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index b34d7893c2c..3015857ca73 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -657,7 +657,7 @@ class Documents extends DolibarrApi throw new RestException(404, 'Category not found'); } - $upload_dir = $conf->categorie->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'category').$object->id."/photos/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->categorie->multidir_output[$object->entity ?? $conf->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'category').$object->id."/photos/".dol_sanitizeFileName((string) $object->ref); } elseif ($modulepart == 'ecm') { throw new RestException(500, 'Modulepart Ecm not implemented yet.'); // require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; @@ -726,7 +726,7 @@ class Documents extends DolibarrApi throw new RestException(500, 'Error while fetching project for task'); } - $upload_dir = $conf->project->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . "/" . dol_sanitizeFileName((string) $object->ref); + $upload_dir = $conf->project->dir_output . "/" . dol_sanitizeFileName((string) $object->project->ref) . "/" . dol_sanitizeFileName((string) $object->ref); } elseif ($modulepart == 'mrp') { $modulepart = 'mrp'; require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php'; @@ -937,7 +937,7 @@ class Documents extends DolibarrApi $project_result = $object->fetchProject(); if ($project_result >= 0) { - $tmpreldir = dol_sanitizeFileName($object->project->ref).'/'; + $tmpreldir = dol_sanitizeFileName((string) $object->project->ref).'/'; } } else { throw new RestException(500, 'Error while fetching Task '.$ref); diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index eccbc6d887b..34c8aad14f2 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -280,7 +280,7 @@ class Orders extends DolibarrApi // Add online_payment_url, cf #20477 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - $commande_static->online_payment_url = getOnlinePaymentUrl(0, 'order', $commande_static->ref); + $commande_static->online_payment_url = getOnlinePaymentUrl(0, 'order', (string) $commande_static->ref); $obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($commande_static), $properties); } @@ -968,7 +968,7 @@ class Orders extends DolibarrApi //fix #20477 : add online_payment_url require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - $this->commande->online_payment_url = getOnlinePaymentUrl(0, 'order', $this->commande->ref); + $this->commande->online_payment_url = getOnlinePaymentUrl(0, 'order', (string) $this->commande->ref); return $this->_cleanObjectDatas($this->commande); } diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a07c158c2f6..369b7c53d58 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -178,7 +178,7 @@ class Invoices extends DolibarrApi // Add online_payment_url, copied from order require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - $this->invoice->online_payment_url = getOnlinePaymentUrl(0, 'invoice', $this->invoice->ref); + $this->invoice->online_payment_url = getOnlinePaymentUrl(0, 'invoice', (string) $this->invoice->ref); return $this->_cleanObjectDatas($this->invoice); } @@ -309,7 +309,7 @@ class Invoices extends DolibarrApi // Add online_payment_url, copied from order require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - $invoice_static->online_payment_url = getOnlinePaymentUrl(0, 'invoice', $invoice_static->ref); + $invoice_static->online_payment_url = getOnlinePaymentUrl(0, 'invoice', (string) $invoice_static->ref); $obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($invoice_static), $properties); } @@ -887,7 +887,7 @@ class Invoices extends DolibarrApi // update bank account if (!empty($this->invoice->fk_account)) { - if ($this->invoice->setBankAccount($this->invoice->fk_account) == 0) { + if ($this->invoice->setBankAccount((int) $this->invoice->fk_account) == 0) { throw new RestException(400, $this->invoice->error); } } @@ -1181,7 +1181,7 @@ class Invoices extends DolibarrApi // copy from order require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - $this->invoice->online_payment_url = getOnlinePaymentUrl(0, 'invoice', $this->invoice->ref); + $this->invoice->online_payment_url = getOnlinePaymentUrl(0, 'invoice', (string) $this->invoice->ref); return $this->_cleanObjectDatas($this->invoice); } diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index aee0bff60de..7c6dab4e261 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -555,12 +555,12 @@ class Mos extends DolibarrApi if (!($line->fk_warehouse > 0)) { // If there is no warehouse set. $langs->load("errors"); $error++; - throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref)); + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), (string) $tmpproduct->ref)); } if ($tmpproduct->status_batch) { $langs->load("errors"); $error++; - throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref)); + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), (string) $tmpproduct->ref)); } } $idstockmove = 0;