Websites using php and mysql stopped sorting drop down lists properly starting last week. Did something change?
We run an open source internal timesheet program called Timesheet Next Gen which is available from Sourceforge. We have been running it for a couple years with no issues. We moved all of our users to Firefox because the developer indicated that there were sorting issues associated with PHP and MYSQL through Internet Explorer. Drop down lists using queried data did not follow the sort order and the list were jumbled in no order with duplicate entries. We had experienced this on our Windows 7 worstations in Internet Explorer (any version) and everything worked fine in Firefox. For the few of us with macbooks, the sorting worked fine in Firefox and Safari.
Starting last week (maybe Tuesday or Wednesday) all of our Windows 7 workstation users started having the same sorting issues in Firefox with our internal timesheet website. There were no changes to the timesheet website or the server that runs it as far as the apache web server and php extensions. I have since updated the server (Ubuntu) and apache, mysql and php are current. Now the sorting in Firefox has quit working on our mac workstations. The only browser that works is Safari. We installed Chrome on both mac and Windows 7 and it does not sort either.
Gekose oplossing
To wrap up this thread, the solution is available here: http://sourceforge.net/p/tsheetx/discussion/779084/thread/02841540/
The general idea behind that solution can be applied to other projects where a JavaScript object is created in PHP and you need to access its members in the order added.
Lees dié antwoord in konteks 👍 1All Replies (10)
Was this change associated with upgrading from Firefox 20 to Firefox 21? To test Firefox 20 again, you could use the "portable" package of Firefox 20.0.1. To avoid a conflict, exit Firefox 21 first before running it, and exit the portable version before running the desktop version. Note: the portable version is an unofficial build.
Does this software have an online demo anywhere? Obviously with MySQL in the mix it's challenging for forum volunteers to build a test environment...
I sent a reply to the email notification for your answer. If I replied to the email notifications, does it show up here? I don't want to have a bunch of double posts...
It works fine on that portable version. We also have one guy with Firefox 17.X whose is still working fine. He is updating his Firefox now so chances are we will know if that is the culprit soon enough.
I can create a temporary user on our system which is accessible from the internet if you want to trouble shoot. Are you a support person for Mozilla?
Also, I have Parallels running on my macbook with IE8 on it. It sorts fine. All of our Windows 7 workstations with IE9 and newer do not.
And... I can confirm the one station with Firefox 17.X that was working, no longer works now that he has updated to version 21.
I'm not sure what happens if you reply to forum notifications; I rarely check that mailbox because it's flooded with so many notifications...
It's great to know that Firefox 20/Portable works. Since that was a clean profile as well, it probably makes sense to test a clean profile in Firefox 21, to rule out an extension or settings-based incompatibility. To do that:
Close Firefox and start up in the Profile Manager as described in Profile Manager - Create, remove or switch Firefox profiles. Any time you want to switch profiles, close Firefox and return to this dialog. I recommend using the default location suggested, and not deleting anything without making backups first.
Does the sorting work in the new profile?
If this is a Firefox 21 change, there is some documentation (e.g., Firefox 21 for developers on MDN). Because there are hundreds of "bug fixes", unfortunately, not every change that affects functionality will make it onto one of the easily readable lists.
I am a volunteer here, not a Mozilla employee.
No luck with the clean profile. Same result. I really appreciate your help.
I got a peek at this code, and the script uses a for (var in object) loop to build a drop-down list. The MDN documentation on the for...in loop says that the elements are returned in arbitrary order, but for years it actually and reliably has been the order the elements were added to the object. Apparently that has changed in Firefox 21 to behave more like other browsers.
There probably are some other scripts that will break as a result. But for scripts that have already been updated to work with Chrome, it shouldn't be a problem. For an old discussion of how different browsers behave with this loop, see this thread complaining about Chrome not behaving like Firefox: Issue 164 - v8 - Wrong order in Object properties interation - V8 JavaScript Engine - Google Project Hosting.
Gekose oplossing
To wrap up this thread, the solution is available here: http://sourceforge.net/p/tsheetx/discussion/779084/thread/02841540/
The general idea behind that solution can be applied to other projects where a JavaScript object is created in PHP and you need to access its members in the order added.