← Back to team overview

mahara-contributors team mailing list archive

[Bug 1776448] Re: lib/view.php get_extra_view_info Trying to get property of non-object

 

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

** Changed in: mahara
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1776448

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

Status in Mahara:
  Incomplete

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1776448/+subscriptions


References