adlnet / Moodle-mod_cmi5launch

A Moodle plugin which allows teachers to upload cmi5 packaged lessons within a Moodle Course Activity and then assign the activity to students
Apache License 2.0
5 stars 5 forks source link

Error referencing missing cmi5launch_usercourse table during upgrade #35

Closed logan-reynolds closed 6 months ago

logan-reynolds commented 6 months ago

When performing an upgrade of latest mod_cmi5launch version 2024030615 (mod_cmi5launch commitid 60004c2 on GitHub) on Moodle 3.11 from prior plugin version 2018110100, the following error is encountered because it appears there is a reference to the 'cmi5launch_usercourse' table which doesn't exist at that stage:

-->mod_cmi5launch
Default exception handler: Table "cmi5launch_usercourse" does not exist Debug: 
Error code: ddltablenotexist
* line 146 of /lib/ddl/database_manager.php: ddl_table_missing_exception thrown
* line 66 of /mod/cmi5launch/db/upgrade.php: call to database_manager->field_exists()
* line 877 of /lib/upgradelib.php: call to xmldb_cmi5launch_upgrade()
* line 576 of /lib/upgradelib.php: call to upgrade_plugins_modules()
* line 1929 of /lib/upgradelib.php: call to upgrade_plugins()
* line 202 of /admin/cli/upgrade.php: call to upgrade_noncore()

This would need to be resolved so that the plugin can always be successfully upgraded to newer versions regardless of what version the user starts out on.

ADLMeganBohland commented 6 months ago

@logan-reynolds Hi Logan, thanks for bringing this to my attention. I thought I had fixed this, I will revisit and adjust the upgrade table. Thanks!

ADLMeganBohland commented 6 months ago

Closing, I tested and believe commit c956e04 repairs this.