-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Forum posts' in My Courses Error #271
Comments
I have done more investigation and it seems that /**
* Get configuration values from the global config table
* or the config_plugins table.
*
* If called with one parameter, it will load all the config
* variables for one plugin, and return them as an object.
*
* If called with 2 parameters it will return a string single
* value or false if the value is not found.
*
* NOTE: this function is called from lib/db/upgrade.php
*
* @param string $plugin full component name
* @param string $name default null
* @return mixed hash-like object or single value, return false no config found
* @throws dml_exception
*/
function get_config($plugin, $name = null) {
....
} The second commit in Pull Request #272 adds this second argument, checking if entry |
Hi @djarran , Thank you for submitting this pull request! We appreciate your contribution. We'll review the changes and provide feedback or merge them. If there are any changes required, I'll add review comments to guide you through them. Thanks again for your contribution. |
Would be great to see this fixed, it's been an issue for years |
Description
Users who have recent forum posts are receiving an error in their "My courses" overview section with
dmlreadexception
. The full error message (below) is attempting to find the forum discussions table for thehsuforum
plugin despite it not being installed:Steps to Reproduce
git clone -b MOODLE_401_STABLE [email protected]:moodle/moodle.git forum-error
)admin/tool/generator/maketestcourse.php
. This should also create a forum.theme_snap
, upgrade MoodleMy Course
buttonProposed Solution
The error is occuring in the
get_groups_ids
function inclasses/local.php
as described in the error in the following conditional starting in line1970
get_config('hsuforum')
returns an empty object (even though it should return false) if the plugin specified doesn't exist, and since an empty object is considered true, this conditional evaluates to false and theSQL
is executed. Changinghsuforum
to a random string shows the same behaviour.Checking if what is returned is an empty object (or false, as that is what
get_config()
should return) as below solves this issue.The text was updated successfully, but these errors were encountered: