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

AI: Prevent provider instance creation when no provider plugins installed.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.0
    • AI
    • MOODLE_500_STABLE
    • main_MDL-84862
    • Hide

      Testing:

      1. Log into the site as an admin
      2. Navigate to: Site Administration > plugins > plugins overview
      3. Unistall any installed AI provider plugins. Typically this will be OpenAI and Azure AI. Don't forget to remove the plugin code from the moodle code directory as part of this process
      4. Navigate to: Site Administration > AI > AI providers
      5. Confirm the "Create a new provider instance button does not appear.
      6. Confirm  the following warning is displayed: " There are no provider plugins installed. Install a provider plugin to enable provider instance creation. "
      7. Navigate to <your site>/ai/configure.php
      8. Confirm The following error is displayed: There are no provider plugins installed. Install a provider plugin to enable provider instance creation.
      Show
      Testing: Log into the site as an admin Navigate to: Site Administration > plugins > plugins overview Unistall any installed AI provider plugins. Typically this will be OpenAI and Azure AI. Don't forget to remove the plugin code from the moodle code directory as part of this process Navigate to: Site Administration > AI > AI providers Confirm  the "Create a new provider instance button does not appear. Confirm   the following warning is displayed: " There are no provider plugins installed. Install a provider plugin to enable provider instance creation. " Navigate to <your site>/ai/configure.php Confirm  The following error is displayed: There are no provider plugins installed. Install a provider plugin to enable provider instance creation.
    • Hide

      Code verified against automated checks.

      Checked MDL-84862 using repository: https://github.com/mattporritt/moodle

      More information about this report

      Built on: Sun Mar 16 07:46:29 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84862 using repository: https://github.com/mattporritt/moodle main (0 errors / 0 warnings) [branch: main_MDL-84862 | CI Job ] More information about this report Built on: Sun Mar 16 07:46:29 UTC 2025

      When all AI provider plugins have been uninstalled, the "Create a new provider instance" is still displayed and can be interacted with. The "Create a new provider instance" form comes up with an empty Choose AI provider plugin" which then results in a coding error after filling out the form and saving it.

       

      Coding error detected, it must be fixed by a programmer: Provider class not valid: \provider
       
      Debug info:
      Error code: codingerrorDismiss this notification
       
      Stack trace:
      line 380 of /ai/classes/manager.php: core\exception\coding_exception thrown
      line 107 of /ai/configure.php: call to core_ai\manager->create_provider_instance()

      When there are no provider plugins installed the "create a new provider instance" button should not be rendered on the provider page. Also the configure.php page that displays the form should display an error if no plugins are installed (in case someone deeplinks to it).

            matt.porritt@moodle.com Matt Porritt
            matt.porritt@moodle.com Matt Porritt
            Raquel Ortega Raquel Ortega
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 42 minutes
                42m

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