Opened 12 years ago
Closed 9 years ago
#24667 closed defect (bug) (wontfix)
Widgets admin broken in IE7
Reported by: | diddledani | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.2 |
Component: | Widgets | Keywords: | |
Focuses: | Cc: |
Description
As per the thread here: http://wordpress.org/support/topic/widgets-admin-in-ie7
Widgets drag-and-drop does not work in IE7. The widget successfully appears in the sidebar after drag but the page does not save the new layout. Pre-existing widgets stay unchanged and any newly added widgets (to any sidebar) disappear after a page reload indicating they're not being saved.
(This may be incorrect on my assumption, but..) I believe the issue is due to the ID disappearing off the widget at the start of a drag action, meaning any further interactions with the widget are lost because the ID has been lost. The error message that IE7 produces at the drop action is as follows:
"'attr(...)' is null or not an object"
The related piece of code which causes the IE7 error message is in widgets.js line 146:
140 receive: function(e, ui) { 141 var sender = $(ui.sender); 142 143 if ( !$(this).is(':visible') || this.id.indexOf('orphaned_widgets') != -1 ) 144 sender.sortable('cancel'); 145 146 if ( sender.attr('id').indexOf('orphaned_widgets') != -1 && !sender.children('.widget').length ) { 147 sender.parents('.orphan-sidebar').slideUp(400, function(){ $(this).remove(); }); 148 } 149 }
note the first part of the if statement uses the return value of sender.attr('id') as an object. IE7 alerts that this is a problem because the ID has disappeared so the return value of sender.attr('id') is correctly not an object. This is a byproduct of the actual problem which is the ID disappearing in the first place.
I cannot pinpoint where the ID is being stripped in the JavaScript, but it appears to be jquery-ui related?
Change History (4)
#2
@
12 years ago
Looks like UI bug. Also seeing this in IE7 on most (all?) elements used with UI Sortable <... id="widget-list" sizzle-1372711503799="[object Object]">
(converting object to string).
In any case our code should check if an ID exists before treating it as a string. Perhaps this:
var id; if ( ( id = sender.attr('id') ) && id.indexOf('orphaned_widgets') != -1 && !sender.children('.widget').length ) { sender.parents('.orphan-sidebar').slideUp(400, function(){ $(this).remove(); }); }
Big -1 to spending extra time fixing something up for IE7.