-
Bug
-
Resolution: Fixed
-
Minor
-
4.5
The analytics code includes a list of classes to use from core module plugins. This can cause problems during install or upgrade if the core module plugin has been removed, because it tries to use a class which does not exist.
When implementing MDL-82359, I fixed the situation where you do a fresh install with a missing plugin. Example sequence that works:
rm -rf mod/chat
(install Moodle)
However there is still a way to reproduce a similar problem if you delete a module, without uninstalling it properly, and then do a Moodle upgrade:
(install Moodle)
rm -rf mod/chat
(upgrade to a newer Moodle version, e.g. for testing just edit version.php to increment the number)
(upgrade Moodle)
The fix I put in to make this work the first time uses \core_plugin_manager::instance() function get_plugins_of_type('mod'), which uses the installed plugin list. Since the situation here is not related to whether plugins have been officially installed, but whether they exist on disk, the correct function to use would be get_present_plugins('mod'). Changing to this function makes it work on both upgrade and initial install.
When it fails, the error in install/upgrade looks like this:
Coding error detected, it must be fixed by a programmer: Invalid indicator classname
|
Debug info: \mod_chat\analytics\indicator\cognitive_depth
|
Stack trace:
|
line 890 of \analytics\classes\manager.php: coding_exception thrown
|
line 811 of \analytics\classes\manager.php: call to core_analytics\manager::validate_models_declaration()
|
line 737 of \analytics\classes\manager.php: call to core_analytics\manager::load_default_models_for_component()
|
line 615 of \lib\upgradelib.php: call to core_analytics\manager::update_default_models_for_component()
|
line 1877 of \lib\upgradelib.php: call to upgrade_component_updated()
|
line 532 of \admin\index.php: call to upgrade_core()
|
- has a non-specific relationship to
-
MDL-82359 Fresh install should be possible with some removed plugins
-
- Closed
-