-
Notifications
You must be signed in to change notification settings - Fork 10
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
Exception - count(): Argument #1 ($value) must be of type Countable|array, null given #15
Comments
Thanks Richard, any chance you can give me access to a course where this happens? |
That is kinda difficult to realize as we do not create accounts in our own Moodle, everyone logs in using ADFS. What I could do is create a backup from this specific assignment and send it to you? Would that help? Also, we are using multiple attempts in assignments. Could that be a problem in the report? |
Yes a backup/restore would probably help and yes multiple attempts might be an issue (though I have a vague recollection of testing against that). |
Error message Exception - count(): Argument #1 ($value) must be of type Countable|array, null given More information about this error Debug info: Error: mdb->get_record() found more than one record!
Invalid get_string() identifier: 'pluginname' or component 'gradingform_'. Perhaps you are missing $string['pluginname'] = ''; in /lang/en/gradingform_.php?
Error: mdb->get_record() found more than one record!
Looking into the plugin function /**
The current query has the potential to join to unrelated course module or context records, that is why it is happening the error. $sql = "SELECT gdef.id AS definitionid, ga.activemethod, gdef.name AS definition |
I will investigate |
I still had this on my to do list, but unfortunately I was unable to share the backup as there's personalized data inside the course. So thanks to @CristhianBohorquez for sharing additional info. I think the trouble is the many 0 points in the rubric. |
Had this same exception, the query above was returning two grade_definitions rows for one assignment ID, and upon examination one row had a mismatch between gdef.method and ga.activemethod. Therefore the next part of code was loading from the wrong mdl_gradingform_x_criteria table (x = guide or rubric) and not populating $data['criteria'], causing the count() null exception on the rubric.php page. What fixed it here was to add an AND onto the last join, JOIN {grading_definitions} gdef ON ga.id = gdef.areaid AND gdef.method = ga.activemethod. |
Alternatively, after I removed my patch and the error came back, a site admin was able to fix the error by deleting the grading guide from the assignment and ensuring that the assignment and advanced grading settings were both set to rubric. |
This pull request will fix the original error reported here |
Describe the bug
A clear and concise description of what the bug is. We are using Moodle 4.3.2
When clicking on the Rubric Breakdown Report the following error occurs: Exception - count(): Argument #1 ($value) must be of type Countable|array, null given
To Reproduce
Screenshots
Our Rubric looks like this:
The text was updated successfully, but these errors were encountered: