MDL-80575 mod_forum: correct field name for "Notify students" setting.

This commit is contained in:
Paul Holden 2024-01-11 11:43:15 +00:00
parent 9587029a46
commit bf34adae73
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

View File

@ -232,8 +232,6 @@ class mod_forum_mod_form extends moodleform_mod {
$gradefieldname = component_gradeitems::get_field_name_for_itemnumber($component, $itemnumber, 'grade');
$gradecatfieldname = component_gradeitems::get_field_name_for_itemnumber($component, $itemnumber, 'gradecat');
$gradepassfieldname = component_gradeitems::get_field_name_for_itemnumber($component, $itemnumber, 'gradepass');
$sendstudentnotificationsfieldname = component_gradeitems::get_field_name_for_itemnumber($component, $itemnumber,
'sendstudentnotifications');
// The advancedgradingmethod is different in that it is suffixed with an area name... which is not the
// itemnumber.
@ -304,13 +302,9 @@ class mod_forum_mod_form extends moodleform_mod {
$mform->setType($gradepassfieldname, PARAM_RAW);
$mform->hideIf($gradepassfieldname, "{$gradefieldname}[modgrade_type]", 'eq', 'none');
$mform->addElement(
'selectyesno',
$sendstudentnotificationsfieldname,
get_string('sendstudentnotificationsdefault', 'forum')
);
$mform->addHelpButton($sendstudentnotificationsfieldname, 'sendstudentnotificationsdefault', 'forum');
$mform->hideIf($sendstudentnotificationsfieldname, "{$gradefieldname}[modgrade_type]", 'eq', 'none');
$mform->addElement('selectyesno', 'grade_forum_notify', get_string('sendstudentnotificationsdefault', 'forum'));
$mform->addHelpButton('grade_forum_notify', 'sendstudentnotificationsdefault', 'forum');
$mform->hideIf('grade_forum_notify', "{$gradefieldname}[modgrade_type]", 'eq', 'none');
}
function definition_after_data() {