I've ended up a bit discouraged about my Sugar involvement (there's probably a blog post about lessons learnt in there, after I finish processing events in a useful way) so I decided it'd be best to step back for a while and digest things in the background before trying again. In the meantime I thought it'd be cool to remove the dust from my old, old, old Moodle plug-in back from college.
Various things learnt, re-learnt and discovered over the past couple of days:
- Remembered my old tip of appending a version number to the Moodle folders in /var/www/ and /var/wwwdata/ so I can install multiple versions of Moodle in parallel without having to remember which version is in "moodle"
- Could not install nor find a threaded mod_php5 Apache module in my Debian repos, had to remove apache and install apache2 prefork instead. To be investigated still, I want to understand why the repos are set up this way.
- Learnt to check http.conf for port conflicts before installing a new module. Django and mod_wsgi trying to read my PHP files on port 80 did not work well.
- After updating the mod_wsgi port in httpd.conf, without having to add or configure anything the php files were running with no issues -- surprising and cool!
- New Moodle point version, woohoo! Go 1.9.8, as smooth to install as usual.
- Happy surprise: my plugin, DVReport, installed and worked properly! Guess there was no major architectural change between 1.9 and 1.9.8... ;)
- Nasty surprise: visualisations (the core of the plugin) were not working
- Realisation #1: using double-quotes (") to delimit text in not proper SQL. This is pretty sad considering how much effort and agony I spent worrying about creating database neutral queries at the time.
- Realisation #2: MySQL is way too kind with horrible, broken, standardless SQL. I must have been tight on a deadline (or on crack) when I wrote one particularly crazy GROUP BY statement. I'm guessing MySQL just ignored the bits that didn't make sense, but since working on this plugin last I've fallen in love with PostgreSQL, who isn't so kind (sloppy?) in parsing queries. I'll keep using Postgres as my main backend (<3), but will be testing with MySQL as well for this plugin considering I'm apparently unable to write db neutral SQL the first time around :)
The project had remained untouched since October 2008, according to GitHub. Since then GitHub has acquired an issue tracker (major YAY!) and a download tab so I cleaned up the wiki (who'd been upgraded and wasn't parsing all the old syntax anymore either) and set those up. Now the only horrible thing that's left, is all that dreadful code... ;)