Patch for "18.10_STABLE" branch: https://reviews.mahara.org/9204
-- 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/1796523 Title: Objectionable content report throws errors on upgraded site Status in Mahara: Fix Committed 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 To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1796523/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

