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,12 +350,14 @@ function profileform_submit(Pieform $form, $values) {
}
}
else {
if ($values[$element] != $profilefields[$element]) {
$classname = generate_artefact_class_name($element);
$profile = new $classname(0, array('owner' => $USER->get('id')));
$profile->set('title', $values[$element]);
$profile->commit();
}
}
}
try {
db_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