So, in the course of reading DK4 bug reports[1] and tech support requests[2], I was seeing a slow but steady trickle of people reporting the following error message when trying to publish a new Diary entry:
Can't call method "id" on an undefined value at /www/dk4-perl/lib/ScoopDK[3]/Event/Story/Tags/SetTags.pm line 209.
Naturally, I couldn't reproduce the bug in cursory testing, so I figured it must be some weird input mangling thing, and went back to helping people with more pressing stuff, like say troubleshooting login problems.
Then after a while I noticed something peculiar.
OK, first a bit of background.
The error message is opaque to you, right? OK, congratulations, you're a normal human being. To me, however, and to similarly afflicted grognards, the error message is saying, plain as day, that someone is entering something into the Tags field in the Diary Editor that is tripping up the publishing function.
Anyone who has been writing software long enough for the photophobia to set in will know what to look for immediately when this crops up in web-based software: Microsoft-style curly quotes, n-dashes disguised as minus signs, the Real Apostrophe, and the rest of the small-time typographical hoodlums committing petty ISO-8859-1[4] violations.
It had to be something like that, right? People cutting and pasting from Microsoft Word to the Tags field, that kind of thing? Because come on, these are tags. Tags are just words, you don't get weird input problems from normal words.
Tags are simple by design. That's the whole point of them. Or it was, when Web 2.0 was making record flights of 230 yards to cheers of "Semantic!". The theory of tags is roughly this:
Imagine you're at the library, but someone has taken away the card catalog, the Dewey Decimal System™[5], and the shelves, and all the pages of the books have been torn out of their bindings and thrown on the floor, so you and all the other Library Patrons are standing there knee deep in paper that smells faintly mildewy.
So Tags comes along and says "Right, it's too hard now for any one person to organize all this, especially with the City Recycling Department dumping anything in here that's made of plant fiber and has letters on it, so let's do this: all of you, just put some sticky notes on whatever's lying around nearby. If you feel like it. That'll get things organized, eventually. Crowd-sourced! Blam!"
Right, that got away from me a little. Anyway.
Tags are supposed to just sit there. If you bother putting them in a database table at all, you can do it in one column (nerds: shut up). Strictly speaking, they shouldn't need any explicit software support at all; it's theoretically enough if people just add something like "tags: pinecones, TSA scan, allergies" whenever they type stuff into the internet. Tags, from the start, were just words. And just-words don't break web sites.
But.
I'm going through those bug reports, and I notice that in a few of them, people mention using the same tag. That particular tag is 'Depression'.
OK, what the hell. I'll test it. Why not.
And lo and behold, when I test a new Diary entry, it fails with the expected error. Every time. Removing the tag 'Depression' fixes it. We have 100% reproducibility. Depression breaks Diaries. Proven, incontestable fact.
This is either the most horrible thing ever, or hilarious, depending on whether or not you're in a frame of mind to imagine the sort of diaries a person might write which they'd want to tag with the word 'Depression', and how such a person might feel if the site refused to publish, spitting out a cryptic software-nerd message at the end.
So knock me down with a monkey's uncle. A word broke our web site. An unfortunate word, but just a word.
Except, of course, it's not just a word. Tags in DK4 are something rather different from the pure, untainted, theoretical tags of web20semanticweb. DK4 tags have strayed from their meta-informational role and been woven a bit more into the social-media fabric[6]. In the process, they've picked up a lot of database columns.
Ah. Database columns, right? No wonder we've got problems. So I go and I look at the database for a while, because I find that sort of thing relaxing. And I notice that out of the thousands[7] of tags, there are just two that have a particular column set to a particular value. One of those two tags is 'Depression'. So I change the column value variable settings parameter bits, et voilà, the problem is fixed. Hallelujah.
So there we have it, valuable lesson learned. Test the words. Words matter. When someone says depression is breaking their software, don't laugh, they might not be crazy.
Oh, and the other tag in the database with the wrong column setting, the other word amongst the thousands that would break the site?
'Bush'.
Yes, that's right. Bush and Depression broke Daily Kos. That's an absolutely irrefutable fact, friends, and don't let anyone tell you different.
Notes:
- The bug report form is what you should use to report flaws in the site when you don't need a response from us.
- If, on the other hand, you are having a problem using the site and need courteous, timely assisstance, you should use the Contact Form.
- There seem to be a few people (nerds) who, upon seeing the string 'ScoopDK' in error message, have concluded that DK4 is still running Scoop. This is not the case. If these people were Alpha nerds, they'd also notice that ScoopDK is just the name of the root class of the DK4 system, and they would of course remember that Scoop had no root class, or any inheritance at all, really, or even a root package for that matter.
- And no, we don't care that your whole system is using Unicode. Every nerd knows that if you're using Unicode, or even just UTF8, then you're using it wrong and it's broken and why are all the other programmers so stupid.
- Yes, the Dewey Decimal System™ is trademarked, and you have to pay a fee if you want to use it. This is why you can't just type a Dewey Decimal number into an online
book media store, and instead have to grope around in each one's home-cooked categorization scheme.
- It's got sequins.
- Over 200,000, if you're curious. Nerd.