WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#4325 closed defect (bug) (worksforme)

Admin page for sidebar widgets report problem in Internet Explorer

Reported by: Bernard_J_L Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Administration Keywords: widgets administration
Focuses: Cc:

Description

This problem was occurring in the previous version of WordPress. We just went to a clean install of WordPress 2.2 and the problem is in that release as well. Since widgets have now become core to WordPress we thought we would report it.

The error message generated by Internet Explorer is


Line: 109
Char: 4
Error 'Draggables.drag[...].element.id is null or not an object
Code: 0
URL: http://++++/YourWordPress/wp-admin/widgets.php[[BR]]


This error does NOT seem to happen on FireFox.

The page, as far as we can tell, works correctly and we are able to use the widgets by ignoring this error.

There were a few other posts over in the support forum but no indication there was a bug report.

If you need additional information don't hesitate to call.

Bernie

Change History (11)

comment:1 foolswisdom7 years ago

What version OF IE?

comment:2 Bernard_J_L7 years ago

This is version 7.0.5730.11 of Internet Explorer

Bernie

comment:3 Bernard_J_L7 years ago

107 $A(Draggables.drags).map(function(o) {o.startDrag(null); o.finishDrag(null);});
108 for ( var n in Draggables.drags ) {
109 if ( Draggables.drags[n].element.id == 'lastmodule' ) {
110 Draggables.drags[n].destroy();
111 break;
112 }
113 }
114 resetPaletteHeight();


Above is the code in question. We don't understand the use of the variable "n". It seems that "n" would cycle through the elements of "Draggables.drags" and not be an index into the elements. Perhaps that is what is going wrong.

Hope that helps.

Bernie

comment:4 follow-up: Bernard_J_L7 years ago

107 $A(Draggables.drags).map(function(o) {o.startDrag(null); o.finishDrag(null);});
108 for ( var n in Draggables.drags ) {
109 if ( Draggables.drags[n].element.id == 'lastmodule' ) {
110 Draggables.drags[n].destroy();
111 break;
112 }
113 }
114 resetPaletteHeight();

Above is the code in question. Line 109 is where things go south. We don't understand the use of the variable "n". It seems that "n" would cycle through the elements of "Draggables.drags" and not be an index into the elements. Perhaps that is what is going wrong.

Hope that helps.

Bernie

comment:5 follow-up: rob1n7 years ago

Can you see if this is still there in the current 2.2 branch?

I have a feeling I fixed this earlier -- the problem sounds familiar.

comment:6 rob1n7 years ago

  • Milestone changed from 2.4 to 2.2.1

comment:7 in reply to: ↑ 5 Bernard_J_L7 years ago

Replying to rob1n:

Can you see if this is still there in the current 2.2 branch?

I have a feeling I fixed this earlier -- the problem sounds familiar.

If you mean the current version of 2.2 that I just downloaded, then yes the problem is in that release. Or are you referring to another release?

Thanks for the quick response.

Bernie

comment:8 Bernard_J_L7 years ago

To my earlier comment that the problem does NOT occur in FireFox: Well perhaps FireFox is not so vocal about the problem.

Using Firebug you see that "n" is undefined going into that loop. It appears the JavaScript implementation tears through that code and does not seem to be bothered by that. I looks like it passing along a zero and then silently turns up null's and does not complain.

Hope this helps.

Bernie

comment:9 rob1n7 years ago

Sorry, I should have been more clear. We've updated many things in /branches/2.2 in the SVN -- that's what I'm referring to. If it's not in there, then I can close this. Otherwise, I'll take a deeper look.

comment:10 in reply to: ↑ 4 Otto427 years ago

Replying to Bernard_J_L:

We don't understand the use of the variable "n". It seems that "n" would cycle through the elements of "Draggables.drags" and not be an index into the elements.

No. Javascript is weird.

Try this code in a page, and you'll see what I mean:

<html>
<body>
<script type="text/javascript">
var x
var mycars = new Array()
mycars[0] = "Saab"
mycars[1] = "Volvo"
mycars[2] = "BMW"
for (x in mycars) {
document.write(mycars[x] + "<br />")
}
</script>
</body>
</html>

comment:11 rob1n7 years ago

  • Milestone 2.2.1 deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.