This is more of a development related question but I am looking for resources on upgrading the contributed blocks to 2.0 from 1.9. Which areas of the codes (block_name.php) needs to be changed, I also understand that the function handling needs to be changed as well...how do I do this....
I don't think anyone has written out all the steps yet. The changes you need to make fall into two cateogories:
A. Changes you need make for blocks in Moodle 2.0:
- Replace the old config.html form (if your block has one) with a Moodle form class.
- Replace config_global.html with a settings.php file (if necessary).
- Replace the old version method with a version.php file (like for other plugins)
B. Then there are the changes that need to be made to all Moodle code for 2.0:
- Changes to any place you access the database, to use the new $DB global.
- Changes to any place where you handle uploaded files, to use the new files API.
- Changes to any CSS or JavaScript to fit in with the new theme system and $PAGE->requires instead of require_js.
- Changes to backup and restore.
The B changes are documented. See the links at the bottom of the Moodle 2.0 release notes.
The A changes are not really documented yet. Look at the changes in some of the blocks in the standard Moodle distribution.
As Tim says, failing a complete "how-to" documentation, the best way to go at the moment is to compare file by file the contents of a 1.9 standard moodle block and its 2.0 version, using e.g. the excellent Winmerge tool.
Joseph
Hi there,
I'm in the process of upgrading an activity module from 1.9 to 2.0 and I was wondering if the html forms need to be converted into the new $mform format or if it will work anyways.
At the minute it doesn't work but it could be a small error. Thanks for your help!
Here are a couple of general links that may help you. Feel free to let me know if you have any particular questions. If you are using a Git repository just send me the link to it and I'll be happy to have a look and make suggestions. Peace - Anthony
I have attached a table with general information about necessary changes to be done when upgrading blocks. I have tried to put together as much as possible though it probably still is very incomplete ...
I would be pleased to recieve your feedback.
Chaim.