FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
87 stars 47 forks source link

fix plugin version for Moodle minor versions >9 #212

Closed PhilippImhof closed 2 years ago

PhilippImhof commented 2 years ago

Currently, the plugin version is calculated by dividing the Moodle version by 10. This is wrong for versions like 3.10 or 3.11:

$ mdk create --version 310 --install --engine mysqli --run dev
$ mdk plugin install qbehaviour_adaptivemultipart stable_310

Retrieving information for plugin qbehaviour_adaptivemultipart and branch 31.0
No result found
Retrieving information for plugin qbehaviour_adaptivemultipart and branch 30.9
No result found
Could not find a file for this plugin

With the fix, it works fine:

$ mdk plugin install qbehaviour_adaptivemultipart stable_310

Retrieving information for plugin qbehaviour_adaptivemultipart and branch 3.1
Found cached plugin file: qbehaviour_adaptivemultipart-310.zip
Extracting plugin...
Upgrading Moodle to install the new plugin

The fix is not perfect, but it will work until we get Moodle to a major version 10...

FMCorz commented 2 years ago

Hi @PhilippImhof,

Thank you for the patch. I manually merged it in commit 7eb376c because to slightly reword the commit message.

Thanks! Fred