Commit bf6a5951 authored by Robert Lyon's avatar Robert Lyon

Bug 1834117: Property of non-object error

behatnotneeded

Change-Id: Iff8bb59f6b8a9dc370264bb303ba36ad9c3a457c
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent d3af6bc0
...@@ -5615,6 +5615,7 @@ class View { ...@@ -5615,6 +5615,7 @@ class View {
else { else {
// Need to find the views to add it to // Need to find the views to add it to
foreach ($viewdata as $k => $v) { foreach ($viewdata as $k => $v) {
if (is_object($v)) {
if (!isset($v->id) || is_null($v->id)) { if (!isset($v->id) || is_null($v->id)) {
continue; continue;
} }
...@@ -5623,6 +5624,16 @@ class View { ...@@ -5623,6 +5624,16 @@ class View {
$viewdata[$k]->tags[] = $tag->tag; $viewdata[$k]->tags[] = $tag->tag;
} }
} }
else {
if (!isset($v['id'])) {
continue;
}
$viewid = (isset($v['viewid']) && !empty($v['viewid'])) ? $v['viewid'] : $v['id'];
if ($viewid == $tag->resourceid) {
$viewdata[$k]['tags'][] = $tag->tag;
}
}
}
} }
} }
} }
......
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