reports page displays error message with an empty DB

Bug #1800961 reported by Cecilia Vela Gurovic on 2018-11-01
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Medium
Cecilia Vela Gurovic
18.10
Medium
Cecilia Vela Gurovic
19.04
Medium
Unassigned

Bug Description

To replicate:
Install a new site in a clean database
go to Admin menu-> Reports

as the database is new, there is no data for the statistics and the following error is displayed
[WAR] 9b (lib/statistics.php:209) Invalid argument supplied for foreach()

Changed in mahara:
milestone: none → 19.04.0
Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
Steven (stevens-q) wrote :

*Environment tested:* Master
*Browser tested:* Chrome

*Preconditions:*
> 1. Install a new site in a clean database

*Test Steps:*
> 1. go to Admin menu-> Reports

*Expected result:* No error message [WAR] 9b (lib/statistics.php:209) Invalid argument supplied for foreach() is displayed

*Actual result:* As expected ✔

Catalyst QA Approved ✔

Reviewed: https://reviews.mahara.org/9280
Committed: https://git.mahara.org/mahara/mahara/commit/b7c588549b6da9eca1632974ea0c5bc42b26451f
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit b7c588549b6da9eca1632974ea0c5bc42b26451f
Author: Cecilia Vela Gurovic <email address hidden>
Date: Thu Nov 1 14:01:13 2018 +1300

Bug 1800961: php foreach should only be used on arrays

trying to use any other type of variable will
throw an exception.
Also, block types and view types should not be
nested in the template

behatnotneeded

Change-Id: I1ea1e3fc9e7ba7734e1b5712467678c001806e65

Robert Lyon (robertl-9) wrote :

As the error only appear if there are no portfolio pages with blocks (eg when site is first made) we won't backport to anything other than 18.10

no longer affects: mahara/18.04

Reviewed: https://reviews.mahara.org/9282
Committed: https://git.mahara.org/mahara/mahara/commit/8053afeb2289ff1c88b95dc52361f4e4379f0fc1
Submitter: Robert Lyon (<email address hidden>)
Branch: 18.10_STABLE

commit 8053afeb2289ff1c88b95dc52361f4e4379f0fc1
Author: Cecilia Vela Gurovic <email address hidden>
Date: Thu Nov 1 14:01:13 2018 +1300

Bug 1800961: php foreach should only be used on arrays

trying to use any other type of variable will
throw an exception.
Also, block types and view types should not be
nested in the template

behatnotneeded

Change-Id: I1ea1e3fc9e7ba7734e1b5712467678c001806e65
(cherry picked from commit b7c588549b6da9eca1632974ea0c5bc42b26451f)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers