From 73d9c4a12ecb90de0208bfab136535dfbf6332f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 16:27:23 +0200 Subject: [PATCH 1/3] Debug v20 --- htdocs/webhook/class/target.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index cb860fab1a6..5a6e94a943c 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -457,6 +457,9 @@ class Target extends CommonObject */ public function update(User $user, $notrigger = 0) { + // Clean trigger_codes + $this->trigger_codes = preg_replace('/[\r\n\s]/', '', $this->trigger_codes); + return $this->updateCommon($user, $notrigger); } From 829fe1dcc066ef895d6a3057fe4a79b1ef85fec3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 16:29:43 +0200 Subject: [PATCH 2/3] Debug v20 --- htdocs/webhook/target_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 63591826abc..7fd775805b6 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; global $conf, $db, $hookmanager, $langs, $user; // Load translation files required by the page -$langs->loadLangs(array('other')); +$langs->loadLangs(array('other', 'admin')); // Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... From 11491bb067581a4c62765e8246edae200a7269e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 17:44:20 +0200 Subject: [PATCH 3/3] Fix error code --- build/generate_filelist_xml.php | 12 ++++++------ htdocs/filefunc.inc.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index d86b652ccb6..66eaa00e345 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -51,7 +51,7 @@ $buildzip = 0; if (empty($argv[1])) { print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; - exit -1; + exit(1); } @@ -87,7 +87,7 @@ while ($i < $argc) { if (empty($release)) { print "Error: Missing release parameter\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(2); } $savrelease = $release; @@ -107,21 +107,21 @@ if (empty($includecustom)) { if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') { print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(3); } } else { $tmpverter = explode('-', DOL_VERSION, 2); if ($tmpverter[0] != $tmpverbis[0]) { print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(4); } } } else { if (!preg_match('/'.preg_quote(DOL_VERSION, '/').'-/', $release)) { print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(5); } } @@ -147,7 +147,7 @@ $outputfile = $outputdir.'/filelist-'.$release.'.xml'; $fp = fopen($outputfile, 'w'); if (empty($fp)) { print 'Failed to open file '.$outputfile."\n"; - exit(-1); + exit(6); } fputs($fp, ''."\n"); diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 8863c06386b..98515c56dc5 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -207,7 +207,7 @@ define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core ph if (!file_exists(DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php")) { print "Error: Dolibarr config file content seems to be not correctly defined.
\n"; print "Please run dolibarr setup by calling page /install.
\n"; - exit; + exit(1); }