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

Sites with custom AI providers broken when upgrading to 5.0

XMLWordPrintable

    • MOODLE_500_STABLE

      This undocumented change to the base provider class API contract (e.g. from a concrete to a static method) in MDL-82977 (5.0):

      -    abstract public function get_action_list(): array;
      +    abstract public static function get_action_list(): array;
      

      Means that any sites with custom enabled AI providers will be broken upon upgrade to 5.0 - when editing a course settings page (or anywhere that uses an editor with AI prompt), for example, we get:

      Edit course settings
       
      Fatal error: Cannot make static method core_ai\provider::get_action_list() non static in class aiprovider_jokes\provider in /opt/moodle/master/src/ai/provider/jokes/classes/provider.php on line 38
      

      This is a non-backwards compatible/breaking API change, and also means that AI providers that work on 5.0 can never work on 4.5, because we get the inverse error to that above:

      Fatal error: Cannot make non static method core_ai\provider::get_action_list() static in class aiprovider_jokes\provider in /opt/moodle/45/src/ai/provider/jokes/classes/provider.php on line 38
      

      This is perhaps less of a concern than those sites upgrading from 4.5 that will be broken until their AI providers are updated/fixed. We should ensure the API doesn't explode so dramatically, and ensure a smoother upgrade experience for our AI users

            Unassigned Unassigned
            pholden Paul Holden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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

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