Recent Activity
Development
Moodle Versions in Git
All versions of Moodle are appropriately tagged in the Moodle git repository (git://git.moodle.or...
Set the Default Date on the Moodle Date Picker
You can set the default date on the Moodle Date Picker using the setDefault method for example: ...
XMLDB constants
Moodle uses XMLDB as an abstraction layer to support multiple database platforms and schema chang...
Turn off Javascript Caching
When developing in Moodle, Javascript caching can be a real pain as you generally need to purge c...
Convert URL object to string
There’s a method in the moodle_url class in lib/weblib.php called __toString() which will convert...
Adding Navigation to a Local Plugin
Here's how to add your local plugin to the following navigation through the settings.php file: ...
Custom Email Signup Registration Form
You can modify the custom auth/email signup registration page with the following steps (note this...
Plugin Dependencies
Plugin dependencies can be added using the $plugin->dependencies attribute in version.php. Th...
Move the Download Options Below a Table
If you are working with flexibile tables (lib/tablelib.php) in Moodle and have table download ena...
Debug SQL generated by $DB methods
A handy debugging tip, if you need to debug the SQL generated by any of the $DB methods (see DML ...
Getting the Moodle Base/Root Directory
The moodle root directory $CFG->dirroot is established in the file lib/setup.php along with ot...
Make a Select Form Field Required
When adding a form rule for select (or multiple select) fields, these need to be applied on the c...
Unknown Error Upgrading Plugin to Version
If you are getting an error like this when attempting to upgrade a plugin: !!! Unknown error upg...
XMLDB Editor and Reserved Names
One (of the many) good reasons to use the XMLDB editor in Moodle rather than hacking the db/insta...
Set User IDs that will always see debug messages
There’s a handy feature in Moodle configuration called $CFG->debugusers = '<moodle_user_ids...
Debug Log Level Values
These are the values you can set for the debug level under: Site administration > Developme...
Upgrading Database Schema for a Plugin
If you need to upgrade your database schema for a custom plugin, e.g. adding a new table or chang...
Moodle Git Branches and Tags
Moodle uses the convention of the branch name MOODLE_XX_STABLE for each stable release e.g. Moodl...
Get Records SQL giving incorrect result
If you have code that uses $DB->get_records_sql() and it is only giving you one row, or an inc...
Setting up a Scheduled Task for your Plugin
Ther are two parts to setting up a scheduled task in your plugin. Create the task class under c...
User Profile Field Select Options
If you need to get the list of user profile field select options for your plugin, you can query t...
Upgrading between Moodle Stable Versions with Git
Due to the large diveregences between moodle stable versions in the Moodle git repository (e.g. M...