Skip to content

Commit

Permalink
Bufix: Set no selection default correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
georgmaisser committed Nov 29, 2024
1 parent 5a8469f commit 3080e75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function definition() {
$records = learning_paths::get_editable_learning_paths();

$select = [];
$select[] = null;
$select[0] = get_string('noselection', 'form');
foreach ($records as $record) {
$select[$record->id] = $record->name;
}
Expand All @@ -101,6 +101,7 @@ public function definition() {
$select,
$options
);
$mform->setDefault('learningpathid', 0);

$mform->addRule('learningpathid', get_string('mform_options_required', 'mod_adele'), 'required', null, 'client');

Expand Down

0 comments on commit 3080e75

Please sign in to comment.