Monthly ArchiveJune 2007
MediaWiki & development robchurch on 27 Jun 2007
Reports and logs
Working on a couple things at the moment; a new reporting mechanism, and some changes to the log formatting code.
Reports
The reporting mechanism will replace the old QueryPage system with a new one based around an abstract Report class, which is then extended to provide concrete functionality. As before, the actual running of the report is done by the superclass, and as before, reports can be cached. However, we’ll be storing sufficient data in the cache to allow filtering by namespace, and excluding redirects, where appropriate.
The report cache script also caches a different set of results for each namespace, so that there’s cached results for all namespaces. What this means is that, for something like Special:WantedPages, we’ll have separate sets for the main namespace, template namespace, etc. so that namespace filtering is still coherent when the cache is in use, as it will be on Wikimedia wikis. Of course, namespace filtering means that some reports have been merged together (Special:UncategorizedPages, Special:UncategorizedImages etc.)
I’ve also found a couple of opportunities to add possibile performance boosts; better indexes and the use of specific thresholds in “longest pages” and “shortest pages”, and something similar in “ancient pages”, which should speed these three up.
Reports are distinguished from other special pages in Special:SpecialPages, and extensions can add their own reports, too, which drop in and work with the report cache right off the bat. I’ve also tweaked the header text and done a lot of UI improvement.
There’s still quite a bit to do at the moment; some final reports need to be ported, and I need to finish rewriting Special:NewPages to be a proper SpecialPage – it was subclassing QueryPage, but there’s absolutely no need for this, since the table it uses – recentchanges – is cached to hell and back. I might end up merging some of the functionality of the NewestPages extension into Special:NewPages, since I’ve had feedback that the extension is better from a user point of view.
Log formatting
The changes to log formatting will mean that we have a clear and consistent single call to format an individual log item from anywhere. Coupled with the storage of some additional data in the recentchanges table, this means that we can go nuts, and have fully internationalised formatted log lines showing up in change lists, too – right now, it’s generated on save (in the content language) and then saved into the recentchanges table.
This allows me to add some much-needed extras and alter some of the log format entries about. For example, when the target is, in fact, a user, then the standard user links can be added. Extensions can either provide a method to do partial formatting, or take over the whole of the formatting process for their log items, which allows maximum flexibility.
This is coming along very successfully, and should also be done soon.
politics & rants robchurch on 27 Jun 2007
Ding, dong, the Bliar’s gone!
As of around 2:00 PM (BST) today, the Queen will formally offer the position of Prime Minister to Gordon Brown.
I can’t really say I’m sorry to see Tony Blair go, but at the same time, I wonder if Brown’s really the most effective Labour leader for the present situation. He’s got about as much charisma as a damp sponge, although I do pity the difficult situation he now has; the appalling state of the NHS, the Iraq war, a fairly splintered political canvas, problems in the Middle East, difficult relations with Iran and Russia…
politics & rants robchurch on 21 Jun 2007
We can’t leave now…
With Gordon Brown’s imminent coronation as Prime Minister of the United Kingdom, a lot of people are demanding that he promise to withdraw our troops from Iraq.
The problem is, he can’t, and neither could another leader, in good conscience, do that. Iraq (and Afghanistan) has an unstable and vulnerable government, and we’re going to be stuck in there with the Americans for quite some time sorting out our mess.
We had a choice about going in, and our leaders took the wrong one. We have a moral choice about leaving, but let’s hope our leaders do the right thing for a change. The US and UK have made beds for themselves, and now we must lie in them.
Wiki & Wikimedia & rants robchurch on 18 Jun 2007
Pot, meet kettle…
“You’re trying to stir up trouble with practically every single e-mail you send.”
This little gem was on the English Wikipedia mailing list. The hypocrisy of some of their users is simultaneously hilarious and atrocious.
MediaWiki robchurch on 13 Jun 2007
FCKeditor
We had a visitor to #mediawiki yesterday, who was trying to get FCKeditor working with MediaWiki 1.9.3, and was at his wits’ end to the point where he was offering monetary rewards to anyone who could help him.
In my usual folly, I made him an interesting offer:
<robchurch> I tell you what, if I can get it working, from scratch, with MediaWiki 1.9.x, within half an hour, I'll tell you exactly how to do it, for nothing.
Well once I’d downloaded the editor and checked out 1.9.3 from a tag, and read the pertinent documentation on working with FCKeditor, I like to think it didn’t take me long to get it done…under 30 minutes, in fact.
My second mistake, of course, will have been making it available to everyone else, too. Should work with any version after 1.9.3, although there is some patching of MediaWiki involved (one line in the autoloader, and a couple of lines in the edit form code), and you have to enable raw HTML (but don’t panic, FCKeditor seems to be protecting against malicious-looking HTML), but someone else ought to find this useful.
Update: I’ve updated the patch to fix some bugs and incorrect assumptions, noted on the discussion page. I should also point out that it’s not FCKeditor protecting against the malicious HTML, but MediaWiki’s own Sanitizer class, which has been tweaked in the new patch to allow some FCKeditor-generated HTML elements through to allow the nifty table generator, etc. to work.