diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index be4f27a141c..48b48191c91 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -344,8 +344,8 @@ if ($action == 'update') if ($result < 0) { - $langs->load("errors"); - $mesg='
'.$langs->trans($actioncomm->error).'
'; + setEventMessage($actioncomm->error,'errors'); + setEventMessage($actioncomm->errors,'errors'); } else { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e4d869a4287..14982928341 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3484,15 +3484,25 @@ function get_date_range($date_start,$date_end,$format = '',$outputlangs='') /** * Set event message in dol_events session * - * @param string $mesgstring Message - * @param string $style Which style to use ('mesgs', 'warnings', 'errors') + * @param mixed $mesgs Message string or array + * @param string $style Which style to use ('mesgs', 'warnings', 'errors') * @return void * @see dol_htmloutput_events */ -function setEventMessage($mesgstring, $style='mesgs') +function setEventMessage($mesgs, $style='mesgs') { if (! in_array($style,array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage'); - $_SESSION['dol_events'][$style][] = $mesgstring; + if (! is_array($mesgs)) // If mesgs is a string + { + $_SESSION['dol_events'][$style][] = $mesgs; + } + else // If mesgs is an array + { + foreach($mesgs as $mesg) + { + $_SESSION['dol_events'][$style][] = $mesg; + } + } } /** diff --git a/test/soapui/Dolibarr-soapui-project.xml b/test/soapui/Dolibarr-soapui-project.xml index 07ca48e5ea6..973bfb6e1d0 100755 --- a/test/soapui/Dolibarr-soapui-project.xml +++ b/test/soapui/Dolibarr-soapui-project.xml @@ -522,7 +522,7 @@ dolibarrkey aaa admin - changeme + admin 1 @@ -536,7 +536,7 @@ - ? + dolibarrkey ? admin admin @@ -740,7 +740,7 @@ dolibarrkey - ? + admin admin @@ -750,27 +750,27 @@ -]]>UTF-8http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php +]]><xml-fragment/>UTF-8http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php - ? + dolibarrkey ? - ? - ? - ? + admin + admin + - ? - ? - ? + 0 + + -]]>http://localhostdolibarr/webservices/server_user.php?wsdl +]]>http://localhostdolibarr/webservices/server_user.php?wsdl @@ -1028,24 +1028,21 @@ -]]>http://schemas.xmlsoap.org/wsdl/http://localhostdolibarr/webservices/server_thirdparty.php<xml-fragment/>UTF-8http://localhostdolibarr/webservices/server_thirdparty.php - - - - - +]]>http://schemas.xmlsoap.org/wsdl/http://localhostdolibarr/webservices/server_thirdparty.php<xml-fragment/>UTF-8http://localhostdolibarr/webservices/server_thirdparty.php + + + dolibarrkey - aaa + PRESTASHOP admin admin - + - 1 - - - - -]]>UTF-8http://localhostdolibarr/webservices/server_thirdparty.php + + + + +]]>UTF-8http://localhostdolibarr/webservices/server_thirdparty.php