Note:

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

Migrating to 2.0 checklist

From MoodleDocs
Revision as of 10:08, 28 January 2011 by Jason Platts (talk | contribs) (Added backup and restore details)

These are things that OU developers have found so far to check/do in code we're migrating from Moodle 1.9 to 2.0. All information on the detail of this checklist can be found elsewhere in Moodle Docs, and particularly from the Migrating_contrib_code_to_2.0

Not all these things are essential for a rush job, but if you did all of them, then that'd be great. We should really mark each one with a priority of some sort!

Please add/edit this list!

Database

  • Leave empty db/update.php file
  • New $DB global objects with functions replace old db functions
  • $DB parameters swapped to ?
  • Add and strip slashes no longer required
  • Remove use of ENUM and ENUMVALUES in install.xml file
  • check use of sql_substr()
  • Get_records() etc now always returning arrays, empty array in case of no records found.
  • Db functions throw errors not return false on error
  • DB functions offer strictness parameters e.g MUST_EXIST
  • Update version.php numbers (esp required)

Page display

  • New $OUTPUT header and footer functions
  • Navigation links need to use $PAGE->navbar
  • Make sure that you instantiate the moodle form before any call to $OUTPUT->header()
  • Create a renderer
  • Change the way image urls are displayed (not $CFG->pixpath any more)
  • CSS changes
    • Change styles.php to styles.css
    • Change page id to new structure e.g. course-format-studyplan to page-course-view-studyplan


Roles and Permissions:

  • array name to $capabilities in access.php
  • Remove references to admin in access.php
  • Rename legacy to archetypes in access.php
  • Add manager archetype in access.php
  • Ensure require_login as well as require_capability checks
  • isguest() is depreicated, use !isloggedin() || isguestuser() instead

Language strings

  • Rename language folder
  • Change $a to {$a} in language files
  • Change popup help files to _help lang strings and shorten
  • Add $string[‘pluginname’] to lang file
  • Add $string[‘pluginadministration’] to lang file

Forms

  • Param_clean parameter type removed
  • type required parameter for optional_and required_param
  • Replace file form elements with new filepicker
  • Replace htmleditor with editor form field type
  • Change setHelpButton to addHelpButton. (You need to change the arguments, but the new ones are simpler.)

General