Skip to content

[docs] Error in version.php #787

Open
@Art4

Description

@Art4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationhelp wantedExtra attention is neededneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions