From bc672e1f6573528562bd7c8fab3577602a639f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:34:00 +0100 Subject: [PATCH 01/11] bad columns ordering in list the good value is allways 42 --- htdocs/product/stock/class/entrepot.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index a062d053ed9..7aeffd9ddbe 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -130,7 +130,7 @@ class Entrepot extends CommonObject 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => -2, 'position' => 35, 'searchall' => 1), 'lieu' => array('type' => 'varchar(64)', 'label' => 'LocationSummary', 'enabled' => 1, 'visible' => 1, 'position' => 40, 'showoncombobox' => 2, 'searchall' => 1), 'fk_parent' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php:1:((statut:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ParentWarehouse', 'enabled' => 1, 'visible' => -2, 'position' => 41), - 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => '$conf->project->enabled', 'visible' => -1, 'position' => 25), + 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => '$conf->project->enabled', 'visible' => -1, 'position' => 42), 'address' => array('type' => 'varchar(255)', 'label' => 'Address', 'enabled' => 1, 'visible' => -2, 'position' => 45, 'searchall' => 1), 'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -2, 'position' => 50, 'searchall' => 1), 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -2, 'position' => 55, 'searchall' => 1), From cf667ad38089171f10df4934eebd78cf5b726e7e Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:50:51 +0100 Subject: [PATCH 02/11] Fix arguments to dol_print_error --- htdocs/categories/viewcat.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a277b9b03c8..9dbbd684cf7 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -6,6 +6,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -220,7 +221,7 @@ if ($elemid && $action == 'addintocategory' && $newobject = new Account($db); $elementtype = 'bank_account'; } else { - dol_print_error("Not supported value of type = ".$type); + dol_print_error(null, "Not supported value of type = ".$type); } $result = $newobject->fetch($elemid); From a5d2ae0eebf85e051682a083040a79d3de352d83 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:50:54 +0100 Subject: [PATCH 03/11] Fix arguments to dol_print_error --- htdocs/core/ajax/ajaxdirpreview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 45104b2ba27..81587567a0c 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -130,7 +130,7 @@ if ($user->socid > 0) { if (preg_match('/\.\./', $upload_dir) || preg_match('/[<>|]/', $upload_dir)) { dol_syslog("Refused to deliver file ".$upload_dir); // Do no show plain path in shown error message - dol_print_error(0, $langs->trans("ErrorFileNameInvalid", $upload_dir)); + dol_print_error(null, $langs->trans("ErrorFileNameInvalid", $upload_dir)); exit; } // Check permissions From 2d84873dbd497596a6b84e5c3bfe60a038b6b7cc Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:50:56 +0100 Subject: [PATCH 04/11] Fix arguments to dol_print_error --- htdocs/core/ajax/ajaxdirtree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 8161f22d703..47e980cfd6c 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -96,7 +96,7 @@ if ($modulepart == 'ecm') { if (preg_match('/\.\./', $fullpathselecteddir) || preg_match('/[<>|]/', $fullpathselecteddir)) { dol_syslog("Refused to deliver file ".$original_file); // Do no show plain path in shown error message - dol_print_error(0, $langs->trans("ErrorFileNameInvalid", GETPOST("file"))); + dol_print_error(null, $langs->trans("ErrorFileNameInvalid", GETPOST("file"))); exit; } From a99853efd34d2075362535d36abfb7f26584920a Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:50:58 +0100 Subject: [PATCH 05/11] Fix arguments to dol_print_error --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c15510ab90b..400311634dd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -854,7 +854,7 @@ abstract class CommonObject $sql .= " AND ref_ext = '".$db->escape($ref_ext)."'"; } else { $error = 'ErrorWrongParameters'; - dol_print_error(get_class()."::isExistingObject ".$error, LOG_ERR); + dol_syslog(get_class()."::isExistingObject ".$error, LOG_ERR); return -1; } if ($ref || $ref_ext) { // Because the same ref can exists in 2 different entities, we force the current one in priority From ddf5156071c1f3581ab510305be48d4110705976 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:51:00 +0100 Subject: [PATCH 06/11] Fix arguments to dol_print_error --- htdocs/core/class/utils.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 88157550cf2..4b801b38603 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -816,12 +816,12 @@ class Utils $moduleobj = new $class($this->db); } catch (Exception $e) { $error++; - dol_print_error($e->getMessage()); + dol_print_error(null, $e->getMessage()); } } else { $error++; $langs->load("errors"); - dol_print_error($langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module)); + dol_print_error(null, $langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module)); exit; } From d885b2d45985e07dd67a1d1e0eda1d0463752735 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:51:02 +0100 Subject: [PATCH 07/11] Fix arguments to dol_print_error --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index cfc9045aae1..febd2a938ea 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -646,7 +646,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, // Check parameters if (empty($name)) { - dol_print_error($db, "Error: Call to function dolibarr_set_const with wrong parameters", LOG_ERR); + dol_print_error($db, "Error: Call to function dolibarr_set_const with wrong parameters"); exit; } From 586de61d44547dc05ae545ac3c99de69aeea90f7 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:51:04 +0100 Subject: [PATCH 08/11] Fix arguments to dol_print_error --- htdocs/public/website/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php index d8447088922..29e389ae1bd 100644 --- a/htdocs/public/website/index.php +++ b/htdocs/public/website/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -191,7 +192,7 @@ if (!$accessallowed) { if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) { dol_syslog("Refused to deliver file ".$original_file); $file = basename($original_file); // Do no show plain path of original_file in shown error message - dol_print_error(0, $langs->trans("ErrorFileNameInvalid", $file)); + dol_print_error(null, $langs->trans("ErrorFileNameInvalid", $file)); exit; } From 4e4d56d8df0f9f3eab714846aa34a40552a54929 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:51:06 +0100 Subject: [PATCH 09/11] Fix arguments to dol_print_error --- htdocs/public/website/javascript.js.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/public/website/javascript.js.php b/htdocs/public/website/javascript.js.php index 4ad388c537c..3ada7012645 100644 --- a/htdocs/public/website/javascript.js.php +++ b/htdocs/public/website/javascript.js.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -139,7 +140,7 @@ if (!$accessallowed) { if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) { dol_syslog("Refused to deliver file ".$original_file); $file = basename($original_file); // Do no show plain path of original_file in shown error message - dol_print_error(0, $langs->trans("ErrorFileNameInvalid", $file)); + dol_print_error(null, $langs->trans("ErrorFileNameInvalid", $file)); exit; } @@ -155,7 +156,7 @@ $original_file_osencoded = dol_osencode($original_file); // New file name encode if (!file_exists($original_file_osencoded)) { $langs->load("website"); print $langs->trans("RequestedPageHasNoContentYet", $pageid); - //dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$original_file)); + //dol_print_error(null,$langs->trans("ErrorFileDoesNotExists",$original_file)); exit; } From 6f87a52791c822bbcdd8a802901e09d1a0dd4eee Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 26 Mar 2024 12:51:08 +0100 Subject: [PATCH 10/11] Fix arguments to dol_print_error --- htdocs/public/website/styles.css.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php index 82686e3e9e6..22e1319322f 100644 --- a/htdocs/public/website/styles.css.php +++ b/htdocs/public/website/styles.css.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -139,7 +140,7 @@ if (!$accessallowed) { if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) { dol_syslog("Refused to deliver file ".$original_file); $file = basename($original_file); // Do no show plain path of original_file in shown error message - dol_print_error(0, $langs->trans("ErrorFileNameInvalid", $file)); + dol_print_error(null, $langs->trans("ErrorFileNameInvalid", $file)); exit; } @@ -155,7 +156,7 @@ $original_file_osencoded = dol_osencode($original_file); // New file name encode if (!file_exists($original_file_osencoded)) { $langs->load("website"); print $langs->trans("RequestedPageHasNoContentYet", $pageid); - //dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$original_file)); + //dol_print_error(null,$langs->trans("ErrorFileDoesNotExists",$original_file)); exit; } From 6c46257bb5a8694f2d8a749d7fc2a3600faad279 Mon Sep 17 00:00:00 2001 From: rsanjoseo Date: Thu, 28 Mar 2024 09:02:55 +0100 Subject: [PATCH 11/11] "Fatal error: Uncaught Error: Call to undefined method stdClass::del_to_abo()" is resolved. When editing a adherent that does not have an email and giving it one, the following error is thrown as the oldcopy attribute is a stdClass. This is fixed by checking that the del_to_abo method exists on the object before trying to use it. --- .../interface_50_modMailmanspip_Mailmanspipsynchro.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index a73a0eb2eb4..7a3f761bd50 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -1,7 +1,8 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Rafael San José * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,7 +116,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers // Add user into some linked tools (mailman, spip, etc...) if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) { if (is_object($object->oldcopy) && (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid))) { // If email has changed or if list has changed we delete mailman subscription for old email - if ($object->oldcopy->del_to_abo() < 0) { + if (method_exists($object->oldcopy, 'del_to_abo') && $object->oldcopy->del_to_abo() < 0) { $this->errors = $object->oldcopy->errors; if (!empty($object->oldcopy->error)) { $this->errors[] = $object->oldcopy->error;