A really bad bug, A really stupid bug, An easy fix with some crazy attempts - Community Credit News

    Community Credit Forums

Community Credit News

A really bad bug, A really stupid bug, An easy fix with some crazy attempts

I just fixed what has apparently ( and sadly) been a longstanding bug in Community Credit having to do with logging in.  In a nutshell, if you enter your username and password when logging in and hit enter, you will see the profile of Karl Shifflett.  Sounds pretty crazy, eh?  Don't get me wrong, Karl is a highly accomplished individual and I am happy to show off his profile to anybody who asks.  Heck, I even nominated him for an MVP which he was just awarded, in fact.  However, you shouldn't really see his profile as a result of trying to login.   Although this bug is rather simple, it is pretty bad from a perception standpoint.  It makes the site appear to be badly broken, IMHO.  Since I am in the habit of clicking on the login button, it is something that I never encountered.

After chatting with Chris Williams, last night, he mentioned that if he types in his UserName and hits enter, he sees Karl's Profile.  I tried it and sure enough I was able to reproduce it.  At this point, I said to myself, the bad news is that this bug exists, but the good news is that I can reproduce it very easily.

What could cause such strange behavior you may be wondering? I know I was.  Believe it or not, it had to do with the fact that if you hit enter when logging in, it doesn't trigger the Submit Button on the login control, but rather the Enter key must bubble up to the next active element, which in this case was the first Profile display icon. As a result, you see the profile of the first person in the list.

So, how to solve it (or not to solve it)...  Well, start by looking at this discussion thread (57 replies).  If you haven't clawed your eyes out yet, keep reading.   These are some pretty convoluded attempts which I am sure may have worked, but I just couldn't bring myself to do them.  Although I did convert the login control to a template, going through some of the other steps just felt so wrong....so did the javascript solution and a few others that I read. 

The Solution? 
The solution was on the page, though, and was the post by Benazir Mandli which was essentially to set the default button on the form to the login button.  Simple as that.  Problem solved.

Page.Form.DefaultButton = btnSubmit.UniqueID;

It is nice to have such a bad bug fixed.

Share this post: Email it! | bookmark it! | digg it! | reddit!


No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems