From e9ce09f9d1a987e812c29198033a0f369c37743b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Feb 2023 18:50:22 +0100 Subject: [PATCH] Doc --- htdocs/core/lib/functions.lib.php | 3 +++ 1 file changed, 3 insertions(+) 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)