lib/view.php get_extra_view_info Trying to get property of non-object

Bug #1776448 reported by Mark Webster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Incomplete
Undecided
Mark Webster

Bug Description

The first foreach $viewdata in the function checks if $v is an object and casts it as one if not. Further down is a second foreach on $viewdata (inside the "if ($gettags && !empty($viewidlist))" conditional) but this one does no checking, which causes errors when $viewdata items are arrays rather than objects.

Proposed fix:
change the first loop to set $v as a reference via &$v to make the cast to object affect the original $viewdata items. The loop only gets from $v and does no setting, so this will be safe to do.

Affects at least Mahara 17.04 and above.

Changed in mahara:
assignee: nobody → Mark Webster (mark-webster-v)
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Can you please provide a bit more information, Mark, to help replicate the issue?

Changed in mahara:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.