Moodle development traffic 32/2010
Latest stable version 1.9.9+
There are 6 commits into the stable branch from the last development week (from Tue Aug 10 to Mon Aug 16). ♦ Petr Å koda applied Matt Clarkson’s SQL related patch in external database enrolment plugin (MDL-23667). ♦ Andrew Davis committed a patch into the Gradebook dealing with a situation when a grade item is linked with a scale that does not exist any more (MDL-19070) and backported a recent Gradebook UI improvement suggested by Caroline Moore (MDL-22931). ♦ Tim Hunt fixed a bug in Quiz module overview report spotted by Brandon Quinn. The bug caused that Moodle notification message could get included in the output stream when generating XLS or ODS report (MDL-23161). Tim also committed a patch provided by Oleg Sychev to properly quote HTML special characters in extra question fields during the question XML export (MDL-23198). ♦ Ashley Holman removed a three seconds delay after sending user-to-user message copy via email. This results in significant speed boost when a mass message is sent to multiple recipients. It seems to me that the delay was intended there to prevent SMTP queue floods and I am personally worried a bit about possible functionality regressions here (MDL-23755).
Future version Moodle 2.0 Preview 4
There were 110 patches committed into the main development branch during the last development week. A single one QA test (MDLQA-245) of all 145 current test cases for the first round of Moodle 2.0 does not pass yet and there are 15 non resolved blockers in the tracker.
Petr Å koda started up his personal crusade against MySQL default storage engine – MyISAM. After a long and flamy discussion in Moodle development chat room, he created an issue in the tracker to discourage all Moodle administrators from using this storage engine. “MyISAM is a not a good choice for Moodle, it will thrash your data sooner or later – this is usually discovered much later during upgrades when it is too late,” says Petr in the tracker. Eloy Lafuente, the Knight in Shining Armor and our database guru, does not agree with Petr’s radical attitude: “I can see the point about recommending to switch to InnoDB (or any other ACID engine), but Moodle has worked under MyISAM for ages and IMO should continue working, at least until 2.1,” he objects.
As a result, InnoDB or XtraDB storage engines are now being used by default for new Moodle 2.0 installations, unless the administrator explicitly claims their will to use MyISAM. A migration tool from MyISAM to InnoDB was added to Moodle to ease the procedure for existing installations. See more details in MDL-23682.
Quotes of the week
“mysqldump is a joke”
– Petr Å koda blames MyISAM for a high chance to produce non-consistent dumps without actual stopping the access to the database for all other clients.
“pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently. pg_dump does not block other users accessing the database (readers or writers).”
– PostgreSQL documentation
“Adding a handful of fields to Moodle core tables is simple in the same way that lighting the fuse on a sticky of dynamite is simple – you don’t want to hang around to look after it.”
– Tim Hunt does not recommend to modify Moodle core tables without trying all other ways of customizations
Playing hide-and-seek with mform elements
During a review of my own code, I realized I constantly forget to declare the value type of hidden elements in my mforms. Especially in those cases where the hidden element is defined as in
$mform->addElement('hidden', 'id', $current->id);
Such usage of hidden elements as carriers of known static values (which is typical usage for them in fact) may give us false impression that the set value is sort of constant. Wrong. Hidden elements are ordinary form elements, they just do not have any visible widget. But for an experienced user (did someone say hacker?) it is easy to set their value manually before submitting the form. So the values of hidden element must be validated as if they were normal input fields, there is nothing special about them. And setting the allowed data type is a first step of the validation. For the example above, something like
$mform->setType('id', PARAM_INT);
should be added into the form definiton() method.


