Convert a Moodle plugin from Moodle 2 to Moodle 3

Convert a Moodle plugin from Moodle 2 to Moodle 3

by Olivier Lafleur -
Number of replies: 7

Hi, 

I just installed a Moodle 3 instance. On that instance, I would want to use the Moodle OU wiki (https://github.com/moodleou/moodle-mod_ouwiki).

However, for the moment, this plugin is only available for Moodle 2.

As a developer, I would like to explore the idea of converting this plugin to Moodle 3.

Is there any reference that I could look that guide a developer in converting a plugin from Moodle 2 to Moodle 3?
If not, what should I look for that would be incompatible between the two versions?

Thanks a lot!

Average of ratings: -
In reply to Olivier Lafleur

Re: Convert a Moodle plugin from Moodle 2 to Moodle 3

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Well, there is a stable branch for 2.9 and there are commits to the github repository since that, so you may find it already works fine on 3.0

I don't think there are any major api changes that would cause a total breakdown, so you would probably find only a few relatively minor tweaks needed (if any). The jump from Moodle2.9->Moodle3.0 was just another step change, rather than the huge shift when it jumped from 1.9->2

Probably worth trying the OU_wiki and testing it - and if you do find bugs in it on Mdl3 then don't forget to report them (and if you can provide fixes too, even better smile )

In reply to Olivier Lafleur

Re: Convert a Moodle plugin from Moodle 2 to Moodle 3

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There shouldn't be anything (much) to change in the plugin. If it works with Moodle 2.7, 2.8 and 2.9, then there is no real reason at all why it would suddenly stop working just because the next version of Moodle has come out (after all, Moodle 2.9 => Moodle 3.0 is no different to Moodle 2.8 => Moodle 2.9).

In reply to Davo Smith

Re: Convert a Moodle plugin from Moodle 2 to Moodle 3

by Olivier Lafleur -

Yes, I've tried it with the latest commits in master and I have this problem.
However, there is a version.php file that looks like this :
https://github.com/moodleou/moodle-mod_ouwiki/blob/master/version.php

Any idea what else I should look at?


Error message

In reply to Olivier Lafleur

Re: Convert a Moodle plugin from Moodle 2 to Moodle 3

by Olivier Lafleur -

Ok. Not sure to understand but I removed the content of the directory, reopened Moodle and put back the 2.9 STABLE release (instead of the last commits in the master branch) and everything is now fine.

Thanks for your help ! ;)

In reply to Olivier Lafleur

Re: Convert a Moodle plugin from Moodle 2 to Moodle 3

by Rex Lorenzo -

Note, I just tried Moodle 3.03 and the master of OU Wiki and it installed correctly for me. Maybe all the files didn't get copied? Anyways, glad you got it working.

OU plugins are very well maintained and they should have a 3.x or such version soon.

In reply to Rex Lorenzo

Re: Convert a Moodle plugin from Moodle 2 to Moodle 3

by Olivier Lafleur -

Yeah, I probably did something wrong the first time. ;)

Thanks for your test !

In reply to Olivier Lafleur

Re: Convert a Moodle plugin from Moodle 2 to Moodle 3

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We have moved our development version of our code to Moodle 3.0, so there probably is a working version of ouwiki for 3.0 somewhere. However, our general policy is to not release a 3.0 compatible version to the plugins database until we have tested it properly. So, you are on your own until then (but taking the latest version from git should be safe.)