In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
Feedback code was doing the following, which is incompatible with the
sec-patched quickforms lib:
- appending '[0]' to non-group element names, meaning type checks in
getCleanType() were falling back to PARAM_RAW instead of PARAM_INT,
and meaning _findValue() was comparing elements it thought to be arrays
with scalar submit values (worked with eval() implementation as the 0th
element of a string was the character, but not working when patched).
- external unit tests incorrectly testing multichoice questions in the
process_page tests - patched lib highlighted failures.
It was also doing the following:
- actively setting null as default element values instead of 0 for
radio buttons and dropdowns (for 'not selected'). This is incompatible
with more recent quickforms lib (see MDL-63070).
- creating groups using addElement instead of addGroup - not recommended
This patch addresses the above.
Now chart data is not visible by default,
we need to click 'Show chart data' to view.
Also, extra space is not required between
% as it's done by chart library
1) The same code used in other Moodle forms is now used in Feedback to display the "There are required fields in this form marked (*/Required field)" message at the top of the screen and each of the asterisks next to required fields.
2) Feedback specific styles (missingrequire, feeback_required_mark), which were used to highlight required and error fields, have been eliminated. These colours are now controlled by the common Moodle styles (mform1, mform, fdescription, required, req and error) that are used throughout the rest of Moodle for a more uniform appearance.
3) Field level error reporting now displays a message instead of just highlighting the field in a similar way that other Moodle forms do.
Affected files:
- /mod/feedback/styles.css
- /mod/feedback/complete.php
- /mod/feedback/complete_guest.php
- /mod/feedback/edit.php
- /mod/feedback/print.php
- /mod/feedback/item/captcha/lib.php
- /mod/feedback/item/info/lib.php
- /mod/feedback/item/multichoice/lib.php
- /mod/feedback/item/multichoicerated/lib.php
- /mod/feedback/item/numeric/lib.php
- /mod/feedback/item/textarea/lib.php
- /mod/feedback/item/textfield/lib.php
- /mod/feedback/lang/en/feedback.php
Signed-off-by: Michael Milette <michael.milette@instruxmedia.com>