Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-85165

Incorrect plugin installation order causes dependency-related failures

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5
    • Installation
    • 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:

      1. Place the following plugins in the local/ folder:
        • local_kopere_bi
        • local_kopere_dashboard
        • local_helpdesk (which depends on the two above)
      1. Go to Moodle's plugin notifications page
      1. Observe the installation order suggested by Moodle
      1. local_helpdesk will attempt to install before its dependencies, resulting in an error

            Unassigned Unassigned
            eduardokraus Eduardo Kraus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.