Commit 445c8b5d authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

submitting the form now works when not all the fields are set (so it works without the language)

parent 1a734f47
......@@ -190,8 +190,10 @@ function accountprefs_submit(Pieform $form, $values) {
// use this as looping through values is not safe.
$expectedprefs = expected_account_preferences();
foreach (array_keys($expectedprefs) as $pref) {
if (isset($values[$pref])) {
$USER->set_account_preference($pref, $values[$pref]);
$form->json_reply(PIEFORM_OK, get_string('prefssaved', 'account'));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment