-
Bug
-
Resolution: Fixed
-
Blocker
-
2.3
When an assignment has been upgraded from 2.2 to 2.3, in certain circumstances it can become broken. Whenever the user submits a change to any setting; Moodle throws an exception. The exception is:
Found more than one record in fetch() !
More information about this error
Debug info:
Error code: morethanonerecordinfetch
Stack trace:
line 467 of /lib/setuplib.php: moodle_exception thrown
line 163 of /lib/grade/grade_object.php: call to print_error()
line 326 of /lib/grade/grade_item.php: call to grade_object::fetch_helper()
line 291 of /course/moodleform_mod.php: call to grade_item::fetch()
line 120 of /mod/assign/mod_form.php: call to moodleform_mod->validation()
line 523 of /lib/formslib.php: call to mod_assign_mod_form->validation()
line 472 of /lib/formslib.php: call to moodleform->validate_defined_fields()
line 569 of /lib/formslib.php: call to moodleform->is_validated()
line 269 of /course/modedit.php: call to moodleform->get_data()
This is very difficult to recreate as it is more of a problem on the qa.moodle.net and Mount Orange School demo site.
To recreate:
Method 1:
Test Pre-requisites:
- Use the attached backup file of the Moodle Features demo course.
Test steps:
- Restore the course and access any of the assignments under the Label OLD 2.2 Assignments. These are 2.2 assignments converted to 2.3 on the MoodleQA site.
- Navigate to Assignment settings and change any setting (I used grading method, setting it to marking guide).
- Click Save and display.
Expected result:
- Moodle displays the correct page (in my case marking guide).
Actual result:
- Moodle displays the aforementioned exception and the changes are not saved.
Method 2 - this only works on my local Moodle with Advanced uploading of files:
Test steps:
- Create an Advanced uploading of files 2.2 assignment subtype in any course.
- Upgrade the assignment to 2.3.
- Navigate to Assignment settings and change any setting (I used grading method, setting it to marking guide).
- Click Save and display.
Expected result:
- Moodle displays the correct page (in my case marking guide).
Actual result:
- Moodle displays the aforementioned exception and the changes are not saved.2