moodle / devdocs

Source of the Moodle Developer Resources and Documentation

Home Page:https://moodledev.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[docs] Error in version.php

Art4 opened this issue · comments

What is the URL of the page?

https://moodledev.io/docs/apis/commonfiles/version.php#supported-versions

What is the issue with this page?

The docs stated, that the property for $plugin->supported should be integer[] and

A set of branch numbers to specify the lowest and highest branches of Moodle that the plugin supports. These value are inclusive.

grafik

But it does not state that there has to be exactly two values. If you provide 3 or more values, only the first 2 values (or more correctly: only values with the keys 0 and 1) will taken into account. One could think that you can also provide a list of all supported versions:

$plugin->supported = [

    // Support from the Moodle 3.11 series.
    311,
    401,
    402,
    // To the Moodle 4.3 series.
    403,
];

If one provides only one value Moodle will fail with an error while installation of the plugin.

$plugin->supported = [
    // Support only the Moodle 4.3 series.
    403,
];

Are you able to provide a patch for this?

Yes - I will create one if requested.