← Back to team overview

mahara-contributors team mailing list archive

[Bug 1799852] Re: View site statistics has error if there are no blocks

 

*** This bug is a duplicate of bug 1800961 ***
    https://bugs.launchpad.net/bugs/1800961

** This bug has been marked a duplicate of bug 1800961
   reports page displays error message with an empty DB

-- 
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/1799852

Title:
  View site statistics has error if there are no blocks

Status in Mahara:
  Confirmed
Status in Mahara 17.10 series:
  New
Status in Mahara 18.04 series:
  New
Status in Mahara 18.10 series:
  Confirmed
Status in Mahara 19.04 series:
  In Progress

Bug description:
  If you install a new site and go to
  http://mahara/admin/users/statistics.php when there are no blocks
  saved, you see

  "Invalid argument supplied for foreach()",
  "~/code/mahara/htdocs/lib/stati...", 210, array(size 18)) at
  ~code/mahara/htdocs/lib/statistics.php:210, referer:
  http://mahara/admin/index.php

  There is an invalid argument in this case as the value of $blocktypecounts is false and the code says:
  foreach ($blocktypecounts as $blocktype) {
  ...get the details...
  }
  We should put it in an if statement to avoid the error.

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


References