Commit d512d738 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Ensure url of owner is always set in artefactchooser (bug #922412)



The artefact_get_owner_info function did not set a url for site-owned
artefacts.  Worse, because the $url variable was sometimes left
unchanged on a loop iteration, site artefacts could end up being
displayed with the site name linked to an unrelated user profile page,
or group homepage, for example.

Change-Id: If25038e77b7019b40482bbe06ea4da70dab7a683
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 10b13ad2
......@@ -1650,6 +1650,7 @@ function artefact_get_owner_info($ids) {
foreach ($data as &$d) {
if ($d->institution == 'mahara') {
$name = get_config('sitename');
$url = '';
}
else if ($d->institution) {
$name = $d->displayname;;
......@@ -1663,10 +1664,7 @@ function artefact_get_owner_info($ids) {
$name = display_name($d);
$url = 'user/view.php?id=' . $d->id;
}
$d = (object) array('name' => $name);
if (!empty($url)) {
$d->url = $wwwroot . $url;
}
$d = (object) array('name' => $name, 'url' => $wwwroot . $url);
}
return $data;
}
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