You are hereBlogs / Dark Siren Sally's blog / Stabbity stab... wtf, Opera?! x.x

Stabbity stab... wtf, Opera?! x.x


By Dark Siren Sally - Posted on 23 March 2008 in Programming, Website

Yeah so... I was going to spend today working on Rosalia's sheet, and then I encountered some sort of maddeningly frustrating bug with the media manager submit button. (The media manager is that window that pops up when you add an image to a Dokuwiki page.)

The bug was unique to the ACH layout I've been using for mine and Kalli's wiki, and only occurred in Opera. Actually, I wouldn't have noticed it at all if Jon wasn't using Opera at the time -- I gave him an account on the DSWiki, so he could put up his first Ex2 char there, too. He went to upload his char's picture and the upload button just wouldn't work. Clicking it did nothing, mouse-overs didn't change the cursor as expected from the CSS... it was just a dud button.

I tried it on every other browser I have (Firefox, IE... god damn, even Safari) and the button worked fine. So I sat here for something like 6 hours just to hunt down what it was that Opera had a problem with.

Believe me, I was frothing. I had wanted to enjoy today, and maybe even get in some more chatting with sis or playing PSU with her and Clark before Selina's game tonight. Of course, the fact the PSU login server went down gave me more time to poke at the button problem, but still... I did NOT want to spend half my day on some little obscure error. If not for my work ethic I might have ignored it. =_= Damned work ethic. I should get paid for this crap. :( I mean, hey, if I got overtime for working on some silly button problem, I'd at least get to pat my back at the end and go "woo, extra money!"

Anyway... to figure out what was wrong I had to do a lot of backtracing through various PHP and CSS files. For example, there's two mediamanager.php files... one is actually a PHP template, and is in the ACH template directory. The other is in /lib/exe, basically one of the executables that are used in various DokuWiki functions. It was by editing the PHP template version that I got my first "clue": I tried taking out the #media__left and #media__right columns that ACH separates the media manager window into, and combined them into a single window, and THEN the button worked.

But I didn't really want to break down the entire layout of my media window just for Opera users. SO! I had to do some more searching. The PHP template file called a function in /inc/template.php, so I went through that looking for the function body, which in turn called several functions in /inc/media.php, including function media_update. This is the core function that builds the media content, including the form for new uploads, to be displayed in the media manager.

I toyed around with media_update a bit, googled a LOT about Opera and <input type=submit>, but had no luck for quite a while. For a while I was thinking the problem had something to do with Opera choking up when putting the submit button in nested divs, but after repeated searches I found NOTHING of the sort about that kind of bug. There were some bugs related to the search button, but had more to do with changing the cursor type. I found something about <fieldset> too, but again it was more a visual thing than something that would affect the submit button.

I was getting desperate at this point, and started messing with taking bits out of the submit button HTML (still in media.php, function media_update) and testing whether it made a difference. When I took out class=button, it took away all the styling I did to the button, but also made it work properly again. That made me rethink things and realize "okay, I've definitely isolated this to be a CSS problem. But not the one I thought it was."

I went back over to the ACH template folder (/lib/tpl/ach) and grepped through media.css for any instances of 'button'. I feel kind of stupid in retrospect not trying that in the first place, but... oh well. What I did was comment out all of the CSS statements that included 'button' or 'input.button' and started uncommenting them one by one until I pinpointed the exact one that made the submit button not work. It turned out to be a 'position: relative' statement on line... 57? I think? Anyway, for some reason that confused Opera as to where the submit button was actually positioned on the page, so it couldn't be clicked.

It's commented out now and everything works fine. o.o

God, but I hate making sites work cross-browser. I hates! I don't even try with EVERY one. The four I test with (IE, Firefox, Opera, Safari) are good enough for me. D:



Announcements

No current announcements posted.

Current Status

Feeling: Thoughtful...
Listening: Radiohead.
Playing: Alteil, PSU, Etrian Odyssey 2.
Roleplaying: RPoL, my new obsession... :D Wardragon, Dark Days!
Writing: RPoL posts, planning for Realm Reformation game.

Recent comments