General developer forum

Time to prepare your plugins for 3.0

 
Picture of Marina Glancy
Time to prepare your plugins for 3.0
Core developersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hello all,

Moodle 3.0 beta is now available for download. It is a good time to start testing and upgrading your plugins.  After you make sure that your plugin works fine on 3.0, please edit the latest version of it in the plugins directory and add Moodle 3.0 to the "Supported Moodle" field.

It is very important to check that all information in version.php is correct. Plugin installation in 3.0 has become easier for administrators (MDL-49329) but it also means that plugins must be very accurate with the information they have in version.php. Always make sure that required Moodle version is correct, dependencies are listed, your plugin version numbers always increment between releases, you specify $plugin->component (MDL-48494) and you never use $module (MDL-43896).

Please read lib/upgrade.txt and make sure you don't use any of deprecated functions. Don't forget to check out upgrade.txt file in your plugin directory, for example mod/upgrade.txt for modules, auth/upgrade.txt for authentication plugins, and so on.

Theme developers take a look at theme/upgrade.txt and theme/bootstrapbase/upgrade.txt, plugins implementing web services might be interested in webservice/upgrade.txt, why not just run git grep "=== 3.0 ===" to see the list of all upgrade.txt files.

Logs now can be backed up and restored. Your plugin may need to define additional mapping for 'objectid' and 'other' fields in the events, see MDL-46455.

There are also some new features for plugin developers such as new autocomplete field (MDL-51247) and ability to hook into user preference page (MDL-50125). See the list of issues affecting developers for more details.

Happy moodling and see you in 3.0!

 
Average of ratings: Useful (11)
Picture of Mike Churchward
Re: Time to prepare your plugins for 3.0
Core developersParticularly helpful MoodlersPlugin developersPlugins guardiansTesters

Thanks Marina -

If a plugin/module was already updated to work on 2.9, is there anything that needs to be done in the code to make it compatible with 3.0? In other words, in 2.9, no developer messages or warning were occurring.

mike

 
Average of ratings: -
Picture of Marcus Green
Re: Time to prepare your plugins for 3.0
Core developersParticularly helpful MoodlersPlugin developersTesters
I suspect most 2.9 code will work without change, but there is no substitute for testing against reality.
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Time to prepare your plugins for 3.0
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

This is the moment when you are really glad if you took the time to write good PHPunit and Behat tests for your plugins.

 
Average of ratings: Useful (4)
Picture of Michael Aherne
Re: Time to prepare your plugins for 3.0
Core developersParticularly helpful MoodlersPlugin developers

Any changes to plugin APIs should be explained in the upgrade.txt file in the root plugin folder, and changes to other core APIs in /lib/upgrade.txt.

 
Average of ratings: Useful (2)
Picture of Marina Glancy
Re: Time to prepare your plugins for 3.0
Core developersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Mike, there are some new deprecations in 3.0 - all mentioned in lib/upgrade.txt and friends. And there were a lot of final deprecations, so if something was only showing debugging message before it may now throw exception. There is 2-major-release rule between soft and hard deprecation.

Please always test plugins with developer debugging level


 
Average of ratings: Useful (1)
Davo
Re: Time to prepare your plugins for 3.0
Core developersParticularly helpful MoodlersPlugin developers

The biggest changes I've noticed are the handling of version.php. If your module has both $module and $plugin syntax in version.php (for backwards compatibility), this is now a fatal error during install (you should hide the $module bit behind if ($CFG->branch < 25)). I don't remember a Debugging warning about this in 2.9, but I might have missed it.

Similarly, a lack of $plugin->component is now fatal, again without any warnings I'm aware of in 2.9 (I could have missed them).

Neither of these are hard to fix.

 
Average of ratings: -
Picture of David Mudrák
Re: Time to prepare your plugins for 3.0
 
Average of ratings: Useful (1)
Gareth J Barnard
Re: Time to prepare your plugins for 3.0
Core developersParticularly helpful MoodlersPlugin developers

Thanks for the heads up Marina.

 
Average of ratings: -