Commit 82ea96af authored by Nigel McNie's avatar Nigel McNie
Browse files

Only update profile fields in the database if they've actually changed.

Spotted by Stephen C on the forums:
http://mahara.org/interaction/forum/topic.php?id=1023#post4942

Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 3794f21f
...@@ -350,10 +350,12 @@ function profileform_submit(Pieform $form, $values) { ...@@ -350,10 +350,12 @@ function profileform_submit(Pieform $form, $values) {
} }
} }
else { else {
$classname = generate_artefact_class_name($element); if ($values[$element] != $profilefields[$element]) {
$profile = new $classname(0, array('owner' => $USER->get('id'))); $classname = generate_artefact_class_name($element);
$profile->set('title', $values[$element]); $profile = new $classname(0, array('owner' => $USER->get('id')));
$profile->commit(); $profile->set('title', $values[$element]);
$profile->commit();
}
} }
} }
......
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