8.6 kinds of hell
First, I must extend thanks and gratitude to Megan of rapunzellstower.com and Kyle of fidgeting.net, whose seemingly-unrelated bug reports, two months apart, provided the solution to an ugly Quarto bug I had repeatedly glimpsed but been unable to personally reproduce.
Silly domesticat. (Most of my bug reports start like that.) Two months of off-and-on hunting for this bug, which consisted of seven characters in one file being misplaced. Which ones, you ask?
Oh, the closing FORM tag.
In February, Kyle pinged me to let me know that he was unable to edit his comments. Two days ago, Megan pinged me to let me know something that I'd suspected was happening - she was unable to edit her account's information. I was confused, because I was able to do both.
I asked Jeff and Chris to check their accounts, to see if they could edit their accounts' information. They could. As could I.
Gareth hit the nail on the head this morning when, after my scratching my head for a couple of hours, he suggested that I ask Megan for copies of the html that her browser was generating. Perhaps some malformed html, he said. Approximately 0.02 seconds later, I had the sinking realization. The Ugly Eureka. The Oh-God-I'm-An-Idiot reaction.
I had spent so much time trying to figure out what the bug was, and I had never asked myself what Kyle and Megan's accounts had in common that Jeff's, Chris's, and mine did not. Right after Gareth suggested malformed HTML, I knew exactly where it was.
In the upper left-hand corner of the Quarto admin screens, there is a helpful little line that indicates current login information. No matter what, it always follows the same pattern: "logged in as [username] to [sitename]." There is one variation, though: users who have accounts to multiple sites within the same install (the install on cat.net runs four sites) will see a dropdown box in place of [sitename], with the current site's name showing in the box.
I'd been asking myself what could be different between the page I was seeing, and the one Kyle and Megan were seeing, that could make a difference to a form submission button.
Kinda forgot about that line up there. Oops.
I'd set up the code so that if a user had accounts on multiple sites, the dropdown box would be shown and the form would be closed, but the line that opened the form was above the if() statement. In other words, people who only had one account would have a form that was opened, but not subsequently closed.
As I have now established, this omission wreaks approximately 8.6 kinds of hell on a page that contains another form. As a result, users fitting Kyle's and Megan's description were unable to edit their account's information, change their password, or edit their comments - while those who had privs to multiple sites never saw any issues at all.
The problem: most of my friends are beta testers. All of the people I would normally ask for testing help - Jeff, jowilson, Brad, Geof, Chris - had multiple accounts, and none of them were able to reproduce the error.
After two months of trying to figure it out, five hours of testing, and one-point-five seconds of actually correcting the error, all appears to be well. Those of you who only have accounts on domesticat should now be able to log in, edit your account information, change your password, and edit the comments attached to your account. In other words, do a lot of the yummy stuff that makes me glad I wrote this silly CMS in the first place.
I am only slightly annoyed with myself for not catching this error sooner; it took getting a second different, but obviously related, bug report for me to come close to getting a bead on the problem. For those of you who have tried to update your account in the interim, please accept my apologies. As Quarto grows more stable these problems are more rare, but I think we can safely expect occasional problems to crop up at random times in the future.
After all, that's part of the 'charm' of domesticat. It's the Russian-roulette of personal websites. Will you get a normal URL or get a PHP session ID in your urls? Will you be able to edit your information? Will you be able to subscribe to comments on posts? Will the silly site even load?
You feelin' lucky, punk?
I should also note that Kyle and Megan each get a point in the Quarto Bug-Squashin' contest, but they shouldn't feel too proud just yet. At last count, Brad and Geof share the lead with 3.7×10^13 bugs apiece, though there's a rumor floating around that Brad's stacked the deck in his favor in case I ever do a recount.
That is all, I think. I am receiving not-so-subliminal signs from Tenzing that kitty lunch is to be served, now. I caught on to the demand somewhere around the fifth time that he walked across my keyboard as I typed. The feline ones have little patience for this typing thing, especially when it interferes with their lunchtime.
Bugs? Bah. Bugs be damned. It's the kitty that's important. One has to have priorities, y'know.