WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#15622 closed defect (bug) (fixed)

nav-menu loading before jquery-ui-sortable

Reported by: Xertoz Owned by:
Milestone: 3.1 Priority: normal
Severity: blocker Version: 3.0.2
Component: Menus Keywords:
Focuses: Cc:

Description

For some reason it seems my installation uses the .sortable() function of jquery-ui-sortable in nav-menu before it is loaded while accessing the WP built-in menu manager. This means the menu manager is rendered completely useless.

The produced error is:
a.menuList.sortable is not a function
/wp-admin/load-scripts.php?c=1&load=jquery,utils,nav-menu&ver=2b05c108d9016a4caa470b8edaf40953
Line 157

There's an easy solution to it, which is to wrap the (function(b){/*code*/})(); of nav-menu into jQuery(window).ready(function(){(function(b){/*code*/})(););

Attaching proposed solution.

Attachments (3)

nav-menu.js (15.1 KB) - added by Xertoz 4 years ago.
Proposed solution for #15622
nav-menu.patch.js (42.1 KB) - added by Xertoz 4 years ago.
Fixed nav-menu.dev.js with discussed jQuery.ready
15622.diff (693 bytes) - added by ryan 4 years ago.

Download all attachments as: .zip

Change History (8)

@Xertoz4 years ago

Proposed solution for #15622

comment:1 @ocean904 years ago

  • Severity changed from blocker to normal

Please upload only a patch and use nav-menu.dev.js.

comment:2 @nacin4 years ago

  • Cc koopersmith added
  • Milestone changed from Awaiting Review to 3.1
  • Severity changed from normal to blocker

This remains an issue we need to solve before release. It affects us in a number of areas.

Issue: Our dependencies as they relate to jquery-ui-* are too complex for our script loader.

Cause: Many jquery-ui-* packages aren't included in the load-scripts payload.

Effect: This, and other issues.

@Xertoz4 years ago

Fixed nav-menu.dev.js with discussed jQuery.ready

@ryan4 years ago

comment:3 @ryan4 years ago

3.0 also seems to load nav-menu before jquery-ui-sortable. nav-menu has no dependencies declared. Does 15622.diff help?

comment:4 @Xertoz4 years ago

15622.diff solves the problem although the line numbers misalign with my version of the file.

comment:5 @ryan4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16752]) Add jquery-ui-sortable dependency to nav-menu. fixes #15622

Note: See TracTickets for help on using tickets.