Objectionable content report throws errors on upgraded site

Bug #1796523 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

I upgraded a site from 18.04 to 18.10RC1 and when pulling up the objectionable content report, I get the following error messages. It works fine on a clean install.

To replicate:

1. Upgrade a site with some content to RC1 / master.
2. Report a page as objectionable.
3. View the objectionable material report.
Expected result: The table is shown.
Actual result: The following error messages.

[WAR] 79 (lib/errors.php:858) Failed to get a recordset: postgres8 error: [-1: ERROR: syntax error at end of input
LINE 11: ....reportedtime >= DATE( $1) AND obj.reportedtime <= DATE( $2)
                                                                        ^] in EXECUTE("SELECT COUNT(*) FROM (SELECT objectid AS viewid, report, NULL AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable"
                      WHERE objecttype = 'view'
                      UNION
                      SELECT va.view AS viewid, o.report, o.objectid AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable" o
                      JOIN "view_artefact" va ON va.artefact = o.objectid
                      WHERE o.objecttype = 'artefact'
                      ) AS obj
                JOIN "view" v ON v.id = obj.viewid
                JOIN "usr" u ON u.id = v.owner WHERE obj.resolvedtime IS NULL AND (u.id IN ('2') AND obj.reportedtime >= DATE(?) AND obj.reportedtime <= DATE(?)")Command was: SELECT COUNT(*) FROM (SELECT objectid AS viewid, report, NULL AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable"
                      WHERE objecttype = 'view'
                      UNION
                      SELECT va.view AS viewid, o.report, o.objectid AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable" o
                      JOIN "view_artefact" va ON va.artefact = o.objectid
                      WHERE o.objecttype = 'artefact'
                      ) AS obj
                JOIN "view" v ON v.id = obj.viewid
                JOIN "usr" u ON u.id = v.owner WHERE obj.resolvedtime IS NULL AND (u.id IN ('2') AND obj.reportedtime >= DATE(?) AND obj.reportedtime <= DATE(?) and values was (0:2014-09-07,1:2018-10-08)
Call stack (most recent first):

    log_message(string(size 2038), integer, true, true) at /home/kristina/code/1810stable/htdocs/lib/errors.php:95
    log_warn(string(size 2038)) at /home/kristina/code/1810stable/htdocs/lib/errors.php:858
    SQLException->__construct(string(size 2038)) at /home/kristina/code/1810stable/htdocs/lib/dml.php:517
    get_recordset_sql(string(size 867), array(size 2)) at /home/kristina/code/1810stable/htdocs/lib/dml.php:276
    count_records_sql(string(size 867), array(size 2)) at /home/kristina/code/1810stable/htdocs/lib/statistics.php:3222
    objectionable_stats_table(integer, integer, array(size 5), null, string(size 107)) at /home/kristina/code/1810stable/htdocs/lib/statistics.php:3176
    objectionable_statistics(integer, integer, array(size 5)) at /home/kristina/code/1810stable/htdocs/lib/statistics.php:4228
    display_statistics(string(size 3), string(size 7), object(stdClass)) at /home/kristina/code/1810stable/htdocs/admin/users/statistics.php:251

[WAR] 79 (lib/dml.php:517) Failed to get a recordset: postgres8 error: [-1: ERROR: syntax error at end of input
LINE 11: ....reportedtime >= DATE( $1) AND obj.reportedtime <= DATE( $2)
                                                                        ^] in EXECUTE("SELECT COUNT(*) FROM (SELECT objectid AS viewid, report, NULL AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable"
                      WHERE objecttype = 'view'
                      UNION
                      SELECT va.view AS viewid, o.report, o.objectid AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable" o
                      JOIN "view_artefact" va ON va.artefact = o.objectid
                      WHERE o.objecttype = 'artefact'
                      ) AS obj
                JOIN "view" v ON v.id = obj.viewid
                JOIN "usr" u ON u.id = v.owner WHERE obj.resolvedtime IS NULL AND (u.id IN ('2') AND obj.reportedtime >= DATE(?) AND obj.reportedtime <= DATE(?)")Command was: SELECT COUNT(*) FROM (SELECT objectid AS viewid, report, NULL AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable"
                      WHERE objecttype = 'view'
                      UNION
                      SELECT va.view AS viewid, o.report, o.objectid AS artefactid, reportedby, reportedtime, reviewedby, review, reviewedtime, resolvedtime, status
                      FROM "objectionable" o
                      JOIN "view_artefact" va ON va.artefact = o.objectid
                      WHERE o.objecttype = 'artefact'
                      ) AS obj
                JOIN "view" v ON v.id = obj.viewid
                JOIN "usr" u ON u.id = v.owner WHERE obj.resolvedtime IS NULL AND (u.id IN ('2') AND obj.reportedtime >= DATE(?) AND obj.reportedtime <= DATE(?) and values was (0:2014-09-07,1:2018-10-08)
Call stack (most recent first):

    get_recordset_sql(string(size 867), array(size 2)) at /home/kristina/code/1810stable/htdocs/lib/dml.php:276
    count_records_sql(string(size 867), array(size 2)) at /home/kristina/code/1810stable/htdocs/lib/statistics.php:3222
    objectionable_stats_table(integer, integer, array(size 5), null, string(size 107)) at /home/kristina/code/1810stable/htdocs/lib/statistics.php:3176
    objectionable_statistics(integer, integer, array(size 5)) at /home/kristina/code/1810stable/htdocs/lib/statistics.php:4228
    display_statistics(string(size 3), string(size 7), object(stdClass)) at /home/kristina/code/1810stable/htdocs/admin/users/statistics.php:251

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/9198

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit cce1ff1b4aade9be3ebc944e4824e34c4d338484
Author: Robert Lyon <email address hidden>
Date: Mon Oct 8 08:08:39 2018 +1300

Bug 1796523: Fixing objectionable report when selected users are in play

behatnotneeded

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

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "18.10_STABLE" branch: https://reviews.mahara.org/9204

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9204
Committed: https://git.mahara.org/mahara/mahara/commit/d267e433e40e14818b50ff844623e231bc54fe36
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 18.10_STABLE

commit d267e433e40e14818b50ff844623e231bc54fe36
Author: Robert Lyon <email address hidden>
Date: Mon Oct 8 08:08:39 2018 +1300

Bug 1796523: Fixing objectionable report when selected users are in play

behatnotneeded

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

Changed in mahara:
status: In Progress → Fix Committed
milestone: 18.10rc1 → 18.10.0
Changed in mahara:
status: Fix Committed → Fix Released
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.