-
Sub-task
-
Resolution: Duplicate
-
Minor
-
None
-
2.2.2
-
MOODLE_22_STABLE
-
Easy
After logging in I encountered the following error.
Strict Standards: Declaration of profile_field_menu::edit_save_data_preprocess() should be compatible with that of profile_field_base::edit_save_data_preprocess() in D:\xampp\htdocs\moodle_testing\user\profile\field\menu\field.class.php on line 104
|
The base class has edit_save_data_preprocess() with two arguments while the function in the menu field extended class only has one. This problem doesn't seem to affect the other profile types. The only other type that overloads this function is textarea and that uses two arguments.
To make this function in the menu field class compliant, I added a second argument (reference) and that resolved the error message.
/**
|
* The data from the form returns the key. This should be converted to the
|
* respective option string to be saved in database
|
* Overwrites base class accessor method
|
* @param integer the key returned from the select input in the form
|
* @param mixed parameter required to satisfy overloading requirements
|
*/
|
function edit_save_data_preprocess($key, &$ignore) {
|
return isset($this->options[$key]) ? $this->options[$key] : NULL;
|
}
|
- duplicates
-
MDL-32405 fix strict PHP notices - part 4
- Closed