"User details" report throws error

Bug #1824674 reported by Kristina Hoeppner on 2019-04-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Robert Lyon

Bug Description

When I run the "User details" report, I get the following error message no matter what settings I use for the columns:

[WAR] e5 (lib/statistics.php:630) count(): Parameter must be an array or an object that implements Countable
Call stack (most recent first):

    log_message("count(): Parameter must be an array or an object t...", 8, true, true, "/home/kristina/code/1904stable/htdocs/lib/statisti...", 630) at /home/kristina/code/1904stable/htdocs/lib/errors.php:520
    error(2, "count(): Parameter must be an array or an object t...", "/home/kristina/code/1904stable/htdocs/lib/statisti...", 630, array(size 16)) at /home/kristina/code/1904stable/htdocs/lib/statistics.php:630
    userdetails_stats_table(10, 0, array(size 5), null, "https://1904stable.anitsirk.wgtn.cat-it.co.nz/admi...") at /home/kristina/code/1904stable/htdocs/lib/statistics.php:577
    userdetails_statistics(10, 0, array(size 5), null) at /home/kristina/code/1904stable/htdocs/lib/statistics.php:4284
    display_statistics("all", "users", object(stdClass)) at /home/kristina/code/1904stable/htdocs/admin/users/statistics.php:251

To replicate:

1. Log in as site admin.
2. Go to Admin menu -> Reports.
3. Click "Configure report".
4. Choose the "User details" report and run it.

Expected result: No error message.
Actual result: Above error message.

Robert Lyon (robertl-9) on 2019-04-15
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Steven (stevens-q) wrote :

Commit hash: 0e24816eddb5c663681ee84dbc79f118fb9558ea
Environment tested: Master
Browser tested: Chrome

PRECONDITIONS:
------------------------
1) Site admin exists
2) Institution admin exists (User1)
3) Institution exists (Institution One)
4) Mahara users exist and are members of Institution One (User2,User3, User4 and User5)

TEST STEPS:
------------------------
1) Log in as site admin.
2) Go to Admin menu -> Reports.
3) Click "Configure report".
4) Choose the "User details" report and run it.
5) Verify No error message is displayed. ✔

NOTE: Could not get an error message to display with or without the patch - I am using php version 7.2.16-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:23:06) ( NTS )

Not sure what the patch does but it does not break anything so that is good

Can you give more details about your set up?

Reviewed: https://reviews.mahara.org/9772
Committed: https://git.mahara.org/mahara/mahara/commit/0e24816eddb5c663681ee84dbc79f118fb9558ea
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 0e24816eddb5c663681ee84dbc79f118fb9558ea
Author: Robert Lyon <email address hidden>
Date: Mon Apr 15 17:22:20 2019 +1200

Bug 1824674: Get correct user count on user stats details page

This fixes a problem for newer PHP versions

behatnotneeded

Change-Id: I62d892889f2ecd69165d791bdbc250487b4443b1
Signed-off-by: Robert Lyon <email address hidden>

Reviewed: https://reviews.mahara.org/9802
Committed: https://git.mahara.org/mahara/mahara/commit/58c25a6011044d322e4392b10596fa3c18ed6122
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 19.04_STABLE

commit 58c25a6011044d322e4392b10596fa3c18ed6122
Author: Robert Lyon <email address hidden>
Date: Mon Apr 15 17:22:20 2019 +1200

Bug 1824674: Get correct user count on user stats details page

This fixes a problem for newer PHP versions

behatnotneeded

Change-Id: I62d892889f2ecd69165d791bdbc250487b4443b1
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 0e24816eddb5c663681ee84dbc79f118fb9558ea)

Changed in mahara:
status: In Progress → Fix Committed
Steven (stevens-q) wrote :

Re-Test - Tested bug using reporter of bug (Kristina's environment) - we could replicate the bug.

1) applied patch and rechecked - no errors were displayed - User details report is working as expected.

Catalyst QA Approved

Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers