Commit 8177e874 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1544382: get_url() and clean url problem



Sometimes the object holding the user data is a StdClass rather than a
User object

behatnotneeded

Change-Id: I39f1333eac08876653a427488280859db1022a90
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 172d0e95
......@@ -5820,7 +5820,10 @@ class View {
$url = 'group/view.php?id=' . $this->group;
}
else if (!$useid && !is_null($this->urlid) && get_config('cleanurls')) {
if ($this->owner && !is_null($this->get_owner_object()->get('urlid'))) {
if ($this->owner &&
($this->get_owner_object() instanceof User && !is_null($this->get_owner_object()->get('urlid'))
|| $this->get_owner_object() instanceof StdClass && !is_null($this->get_owner_object()->urlid))
) {
return profile_url($this->ownerobj, $full) . '/' . $this->urlid;
}
else if ($this->group && !is_null($this->get_group_object()->urlid)) {
......
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