Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.0.8, 2.1, 2.2, 2.3, 2.4
-
Component/s: Forum, Performance
-
Database:Any, PostgreSQL
-
Testing Instructions:
-
Workaround:
-
Affected Branches:MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
-
Fixed Branches:MOODLE_22_STABLE, MOODLE_23_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-32931_master -
Pull Master Diff URL:
Description
The forum overview used by the course overview block counts the number of new posts in forum discussions for courses in which the user is enrolled.
This currently does not return the correct results; its search method is to scan the log table for 'add post' actions - however, posts can be added through other means without an 'add post' action being logged (for example, during the start of a new discussion, a new post is added but only the action 'add discussion' is logged).
A side consequence of using the database log table for this work is that it can by abysmally slow given a large dataset in the log table. This is especially the case when scanning for new posts in a course which the user has never accessed ($course->lastaccess == 0) as this can then do a scan on the entirety of the log table for all posts since the beginning of the Moodle and can cause cache evictions from the database buffers for other, more useful data.