Hi Petr
I agree to explicitely set PARAM types is you think it is necessary
However the moodlelib.php should also be modified
/**
- Returns a particular value for the named variable, taken from
- POST or GET, otherwise returning a given default.
*
- This function should be used to initialise all optional values
- in a script that are based on parameters. Usually it will be
- used like this:
- $name = optional_param('name', 'Fred');
*
- @param string $parname the name of the page parameter we want
- @param mixed $default the default value to return if nothing is found
- @param int $type expected type of parameter, default PARAM_CLEAN
- @return mixed
*/
function optional_param($parname, $default=NULL, $type=PARAM_CLEAN) {
...
In the edit_calculatedsimple_form.php the default values were sufficient as in no case the values are stored directly in the database by this file.
They are further processed by the other edit questions flowchart including moodleforms functions.
As I did not want to interfere in the following processes, I did not specify further the PARAM TYPE and the default null so the simple calls $name = optional_param('name') were used.
The main aspect of edit_calculatedsimple_form.php is to put all the necessary parameters defined in the three pages edit___forms.php of calculated in one page without saving anything in the database until the user click on the SAVE button.
In this way there can be also a real CANCEL which is not the case for the calculated three pages actual process.
Hi Petr
I agree to explicitely set PARAM types is you think it is necessary
However the moodlelib.php should also be modified
/**
*
*
*/
function optional_param($parname, $default=NULL, $type=PARAM_CLEAN) {
...
In the edit_calculatedsimple_form.php the default values were sufficient as in no case the values are stored directly in the database by this file.
They are further processed by the other edit questions flowchart including moodleforms functions.
As I did not want to interfere in the following processes, I did not specify further the PARAM TYPE and the default null so the simple calls $name = optional_param('name') were used.
The main aspect of edit_calculatedsimple_form.php is to put all the necessary parameters defined in the three pages edit___forms.php of calculated in one page without saving anything in the database until the user click on the SAVE button.
In this way there can be also a real CANCEL which is not the case for the calculated three pages actual process.
- Returns a particular value for the named variable, taken from
- POST or GET, otherwise returning a given default.
*
- This function should be used to initialise all optional values
- in a script that are based on parameters. Usually it will be
- used like this:
- $name = optional_param('name', 'Fred');
*
- @param string $parname the name of the page parameter we want
- @param mixed $default the default value to return if nothing is found
- @param int $type expected type of parameter, default PARAM_CLEAN
- @return mixed
*/
function optional_param($parname, $default=NULL, $type=PARAM_CLEAN) {
...
In the edit_calculatedsimple_form.php the default values were sufficient as in no case the values are stored directly in the database by this file. They are further processed by the other edit questions flowchart including moodleforms functions. As I did not want to interfere in the following processes, I did not specify further the PARAM TYPE and the default null so the simple calls $name = optional_param('name') were used. The main aspect of edit_calculatedsimple_form.php is to put all the necessary parameters defined in the three pages edit___forms.php of calculated in one page without saving anything in the database until the user click on the SAVE button. In this way there can be also a real CANCEL which is not the case for the calculated three pages actual process.