Commit 6ecbe067 authored by Aaron Wells's avatar Aaron Wells Committed by Son Nguyen

Update session-cached display name when deleting it

Bug 1223063: ArtefactTypeCachedProfileField was only updating
the session cache when you updated a value, not when you deleted it.
Of course, the only one that can get deleted and that is shown
anywhere is the PreferredName (aka display name) so only this
one shows the problem.

Change-Id: I55f9c96b59c91ced5cba3cf6443ba2e222201ef7
Signed-off-by: Aaron Wells's avatarAaron Wells <aaronw@catalyst.net.nz>
parent 5f4f047d
......@@ -545,16 +545,16 @@ class ArtefactTypeProfileField extends ArtefactTypeProfile {
}
class ArtefactTypeCachedProfileField extends ArtefactTypeProfileField {
public function commit() {
global $USER;
parent::commit();
$field = $this->get_artefact_type();
if (!$this->deleted) {
$field = $this->get_artefact_type();
set_field('usr', $field, $this->title, 'id', $this->owner);
if ($this->owner == $USER->get('id')) {
$USER->{$field} = $this->title;
}
}
if ($this->owner == $USER->get('id')) {
$USER->{$field} = $this->title;
}
}
......
Markdown is supported
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