Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Migrating contrib code to 2.0: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
(15 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{stub}}
{{Moodle 2.0}}
{{Moodle 2.0}}
<p class="note">WARNING: Under construction RIGHT NOW!</p>


The goal of this page is to provide a checklist of tasks to be considered to upgrade CONTRIB code to Moodle 2.0. Several significant changes have taken place including the File API, DB Layer, Navigation, Output renderer, etc. It would be good if we had a list that contributors could follow to help move them toward being able to migrate the code. Any help in building up this list is greatly appreciated.  
The goal of this page is to provide a checklist of tasks to be considered to upgrade CONTRIB code to Moodle 2.0. Several significant changes have taken place including the File API, DB Layer, Navigation, Output renderer, etc. It would be good if we had a list that contributors could follow to help move them toward being able to migrate the code. Any help in building up this list is greatly appreciated.  
Line 7: Line 7:
''Please add useful links...''
''Please add useful links...''


== Installation ==
The 'requires' version in the plugin's version.php is checked to make sure it looks like Moodle 2.0. You should change this value to '2010112400' or later otherwise plugin installation will abort.
== Database ==
* [[DB_layer_2.0_migration_docs]]
* [[DB_layer_2.0_migration_docs]]
== File system ==
== Forms API ==
* [[Using the File API in Moodle forms]]
* [[Using the File API in Moodle forms]]
* [[Using_the_file_API]]
== Themes ==
* [[Output_renderers]]
* [[Output_renderers]]
* [[Text formats 2.0|Text formats 2.0]] how user-entered content is handled.
* [[Migrating_your_code_to_the_2.0_rendering_API]] (n.b., some info outdated and may need updating)
* [[Migrating_your_code_to_the_2.0_rendering_API]] (n.b., some info outdated and may need updating)
* [[Themes_2.0]]
* [[Themes_2.0]]


Some details of how to re-design image CSS for plugin code ar in the main themes documentation: [[Themes_2.0_creating_your_first_theme#Using_images_within_CSS]]
Some details of how to re-design image CSS for plugin code are in the main themes documentation: [[Themes_2.0_creating_your_first_theme#Using_images_within_CSS]]


Be aware that themes are now cached on the server and so emptying your browser cache will not refresh the CSS. This can only be done by going to the site administration->appearance->themes->theme selector page and clicking the 'invalidate theme caches' button.
Be aware that themes are now cached on the server and so emptying your browser cache will not refresh the CSS. This can only be done by going to the site administration->appearance->themes->theme selector page and clicking the 'invalidate theme caches' button.


Javascript is included in different ways now and will need to be migrated, see the PHPDoc comments in /lib/outputrequirements.lib and some (slightly outdated) advice here: [[JavaScript_guidelines]]
== JavaScript ==
JavaScript is included in different ways now and will need to be migrated, see the PHPDoc comments in /lib/outputrequirements.lib and some (slightly outdated) advice here: [[JavaScript_guidelines]]


== Backup and Restore ==
* [[Backup_2.0_for_developers]]
* [[Restore_2.0_for_developers]]
== Miscellaneous ==
There are other coding changes such as:
There are other coding changes such as:
* MDL-24063 which eliminates PARAM_CLEAN  
* MDL-24063 which eliminates PARAM_CLEAN  
* MDL-24058 about no longer using stripslashes or addslashes
* MDL-24058 about no longer using stripslashes or addslashes
* [[Deprecated_functions_in_2.0]]
* Upgrading blocks from Moodle 1.9 to Moodle 2.X: http://moodle.org/mod/forum/discuss.php?d=165086


Please feel free to add others that come to mind. CONTRIB maintainers should check their 2.0 versions for these and make sure that they are appropriately handled.  
Please feel free to add others that come to mind. CONTRIB maintainers should check their 2.0 versions for these and make sure that they are appropriately handled.  


==See also==
== See also ==


* [[Moodle_2.0_release_notes]]
* CONTRIB-1988
* CONTRIB-1988
* http://cvs.moodle.org/moodle/blocks/upgrade.txt?view=markup
* http://cvs.moodle.org/moodle/blocks/upgrade.txt?view=markup
* http://cvs.moodle.org/moodle/mod/upgrade.txt?view=markup
* http://cvs.moodle.org/moodle/mod/upgrade.txt?view=markup
* [[User:Frank_Ralf/Experience_of_converting_a_module_to_Moodle_2|Experience of converting a module to Moodle 2]] by Sam Marshall (perhaps that documentation should better live here? --[[User:Frank Ralf|Frank Ralf]] 16:36, 15 November 2010 (UTC))
* [[Local_customisation]]
* [[Migrating to 2.0 checklist]] list of things to look out for when upgrading a plug-in
* [http://tandl.churchward.ca/2011/10/converting-m19-plug-ins-to-m2-block.html Mike Churchward's "Converting M1.9 Plug-ins to M2"]
[[Category:Guidelines for contributors]]

Revision as of 15:25, 22 November 2011


Moodle 2.0


The goal of this page is to provide a checklist of tasks to be considered to upgrade CONTRIB code to Moodle 2.0. Several significant changes have taken place including the File API, DB Layer, Navigation, Output renderer, etc. It would be good if we had a list that contributors could follow to help move them toward being able to migrate the code. Any help in building up this list is greatly appreciated.

Please add useful links...

Installation

The 'requires' version in the plugin's version.php is checked to make sure it looks like Moodle 2.0. You should change this value to '2010112400' or later otherwise plugin installation will abort.

Database

File system

Forms API

Themes

Some details of how to re-design image CSS for plugin code are in the main themes documentation: Themes_2.0_creating_your_first_theme#Using_images_within_CSS

Be aware that themes are now cached on the server and so emptying your browser cache will not refresh the CSS. This can only be done by going to the site administration->appearance->themes->theme selector page and clicking the 'invalidate theme caches' button.

JavaScript

JavaScript is included in different ways now and will need to be migrated, see the PHPDoc comments in /lib/outputrequirements.lib and some (slightly outdated) advice here: JavaScript_guidelines

Backup and Restore

Miscellaneous

There are other coding changes such as:

Please feel free to add others that come to mind. CONTRIB maintainers should check their 2.0 versions for these and make sure that they are appropriately handled.

See also