-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.5
-
None
-
MOODLE_405_STABLE
When installing plugins that have explicit dependencies on other plugins (such as local_helpdesk, which depends on local_kopere_bi and local_kopere_dashboard), Moodle installs the plugins in alphabetical order instead of respecting the declared dependencies.
Scenario:
- Plugin local_helpdesk depends on local_kopere_bi and local_kopere_dashboard
- During batch installation, Moodle installs local_helpdesk first, which fails because required classes from local_kopere_bi are not yet available
- Only afterwards does Moodle install local_kopere_bi and local_kopere_dashboard
Expected Behavior:
Moodle should:
- Read the list of dependencies declared in each plugin’s version.php
- Resolve the correct installation order based on those dependencies
- Install local_kopere_bi and local_kopere_dashboard before local_helpdesk
Current Behavior:
- Installation follows alphabetical order and ignores declared dependencies
- This causes installation failures or unexpected behavior for plugins that rely on others
Impact:
- Damages the user experience and the reliability of the plugin installation system
- May result in incomplete or corrupted installations
Suggested Solution:
- Implement a topological sort algorithm to resolve dependencies between plugins before performing batch installation
- Validate the presence and initialization of dependent plugins before attempting to install the main plugin
Steps to Reproduce:
- Place the following plugins in the local/ folder:
-
- local_kopere_bi
-
- local_kopere_dashboard
-
- local_helpdesk (which depends on the two above)
- Go to Moodle's plugin notifications page
- Observe the installation order suggested by Moodle
- local_helpdesk will attempt to install before its dependencies, resulting in an error