-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Roan Kattouw wrote:
Some possible solutions to this, in no particular order:
- delete the damn page entry from the database
That should happen. Someone (not me, I suck at that) should write a maintenance script for that.
cleanupTitles.php & co -- been there for a million years. Currently not all tables in all places are well covered by a cleanup script, though.
In general, due to the delays between changes of what's valid or fixes of buggy generating code and subsequent cleanup, you should always assume that the DB may contain "ghost" data.
- change the API so that, if there is a bad title in the titles=
parameter, it still returns the query result for all the valid titles.
That's what I'm gonna do when I fix bug 13390 (it's on my TODO list).
It's always best to handle invalid data gracefully, especially when it's easy to encapsulate like this.
Generally we assume that titles we find in the db will be valid, except when they're not. ;) That means you can treat them as valid for purposes of, say, optimizing creation of objects (with Title::makeTitle), but you should still watch out for surprises.
Sometimes you'll end up with a null when you expected an object, and it's wise to pass it over and render out the rest of the list intact. Sometimes this means putting in a placeholder results ("Invalid title!"), sometimes just dropping it from a list is better.
- -- brion vibber (brion @ wikimedia.org)