Tuesday, October 25, 2011

Converting M1.9 Plug-ins to M2

Now that we're well into Moodle 2 (M2), with the current stable release being 2.1.2, I thought it would be a good time to revisit converting legacy Moodle code to the new platform.

You may ask why I am doing this at such a late date? For four reasons:
  1. Many existing users of Moodle have not taken the plunge to M2 yet, but will be over the next several months.
  2. There aren't many complete guides to converting code out there, so it should prove to be a helpful exercise to document this as I do it.
  3. While I have converted a number of plug-ins to M2 in the past 1.5 years, I haven't done it recently.
  4. I miss touching code!
My goal here will be to take something existing in the community, that was useful in 1.9 (and earlier) but has not yet been ported to M2, and port the code while documenting my efforts here in this blog. As I go, I will use the resources in the community, and share them with you, so that we can all learn the best way to do this and learn the best places to find our information. (I will cheat a bit and use the documents we have created here at Remote-Learner used by our development team as well). I'm pretty sure we will also learn what not to do!

I will start with a popular block, posted at moodle.org, called "Twitter Search". This block allows you to display a block on a Moodle page that displays tweets from defined search tags. Each block can be configured to display different hash tags.

Over the next few days, I will begin the process of porting it to Moodle 2.1, and document my efforts here. When done, there will be a working M2 version of this block that can be used by the community.

After that, we'll try some other plug-ins. Post your suggestions here or to my twitter feed.