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); 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 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; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cb3fb80bbf6..9f93e22fcda 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -913,7 +913,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 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; } 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; } 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), 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; } 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; } 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; }