-
Bug
-
Resolution: Fixed
-
Critical
-
3.9.20, 3.11.13, 4.0.7, 4.1.2, 4.2
-
2
-
Team Hedgehog 2023 Sprint 1.4
-
Small
We found while doing a test Moodle 4.2 beta upgrade that our database has leftover assignment grade_items and grade_grades, even though we converted to assign long long long ago, and in fact, we have no entries in the mdl_assignment table (this also means that the check_mod_assignment environment check passes just fine). Ultimately this results in this error:
-->assignment
|
!!! Cannot be executed during upgrade !!!
|
!!
|
Error code: cannotexecduringupgrade !!
|
!! Stack trace: * line 1464 of /lib/setuplib.php: moodle_exception thrown
|
* line 2543 of /lib/modinfolib.php: call to upgrade_ensure_not_running()
|
* line 2578 of /lib/grade/grade_item.php: call to get_fast_modinfo()
|
* line 1253 of /lib/grade/grade_grade.php: call to
|
grade_item->get_context()
|
* line 1101 of /lib/grade/grade_grade.php: call to
|
grade_grade->get_context()
|
* line 304 of /lib/grade/grade_object.php: call to
|
grade_grade->delete_feedback_files()
|
* line 1122 of /lib/grade/grade_grade.php: call to
|
grade_object->delete()
|
* line 448 of /lib/grade/grade_item.php: call to grade_grade->delete()
|
* line 419 of /lib/grade/grade_item.php: call to
|
grade_item->delete_all_grades()
|
* line 1543 of /lib/gradelib.php: call to grade_item->delete()
|
* line 262 of /lib/classes/plugininfo/mod.php: call to
|
grade_uninstalled_module()
|
* line 203 of /lib/adminlib.php: call to
|
core\plugininfo\mod->uninstall_cleanup()
|
* line 3201 of /lib/db/upgrade.php: call to uninstall_plugin()
|
* line 1905 of /lib/upgradelib.php: call to xmldb_main_upgrade()
|
* line 268 of /admin/cli/upgrade.php: call to upgrade_core()
|
!!
|
|
While this is obviously some weird edge case, I'm pretty sure they upgrade should be more resilient to this issue - because this site this was testing on is nothing special, other than it a large site that has been in use a long long time (but kept very updated).
Steps to reproduce
- Create a new 4.1 instance and install it
- Make sure you turn on the debugging
- Create a course and an assignment in the new created course
- Grade the assignment
- Add: grade_update('mod/assignment',$course->id, 'mod', 'assignment', 10, 0, 80); to the end of mod/assign/view.php file to generate invalid data.
- Visit the graded assignment page
- Upgrade to 4.2 by checking out master branch
- Follow the upgrade process
- Verify that you see a warning or exception like the following screenshoot
- Discovered while testing
-
MDLQA-17612 CLONE - Upgrade test using a big data set with many courses
- Passed
- has a non-specific relationship to
-
MDL-77829 Admin/environment.xml MUST be 100% the same in all supported (normal and security) branches.
- Closed
- is a regression caused by
-
MDL-72350 Remove Assignment 2.2 (mod_assignment) from core
- Closed
- Testing discovered
-
MDL-77988 Faulty plugin uninstallation logic causes redundant table reads
- Closed