diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3a51575ef57..9311adb11ef 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -411,6 +411,9 @@ function dol_shutdown() /** * Return true if we are in a context of submitting the parameter $paramname from a POST of a form. + * Warning: + * For action=add, use: $var = GETPOST('var'); // No GETPOSTISSET, so GETPOST always called and default value is retreived if not a form POST, and value of form is retreived if it is a form POST. + * For action=update, use: $var = GETPOSTISSET('var') ? GETPOST('var') : $object->var; * * @param string $paramname Name or parameter to test * @return boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty)