Opened 15 years ago
Closed 15 years ago
#13037 closed defect (bug) (fixed)
Nav menu doesn't like when item is a child of itself
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | high |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
Page - About ----Category - Uncategorized --------Page - About
Save Menu
Fatal error: Maximum function nesting level of '100' reached, aborting! in (...) on line 147
Attachments (4)
Change History (11)
#2
@
15 years ago
for reference: to post code & formatted text, wrap it in 3 brackets like this: (Thats wrapped in brackets to show it)
{{{ ...the code here... }}}
#4
@
15 years ago
- Keywords has-patch needs-testing added
Patch extends current JavaScript for blocking this from happening (does not solve the underlying problem which would exist for non-js version of menus). Might not be the most optimised method for doing this, if this is the case it still serves as an example (especially since the nav menu feature is currently changing).
#5
@
15 years ago
- Keywords needs-patch added; has-patch needs-testing removed
This bug has changed since filosofo's major update was applied:
Now if you try to make a post/page/whatever a child of itself in a menu you encounter a JavaScript error any time you try to load the menus page, causing only half of the page to render. Steps:
- Create a menu
- Add the same post to menu twice
- Make post child of itself
- Click save
The error which occurs:
Uncaught TypeError: Object #<an Object> has no method 'autocomplete'
, line 312 of nav-menu.dev.js
Using console.log(el) before this call I get the quick-search-posttype-post input element, this suggests this is the element throwing the error.
Not had much chance to look into this, busy with exams :-(, but seems like there a no checks in place to stop menu elements being children of themselves.
#6
@
15 years ago
The same problem is also encountered when trying to set an item as the child of another item but has the same ID (i.e. the same menu-item-object-id). An example of this is with Hello World post (id = 1) and Uncategorized (id = 1).
Side note: issues also crop up with clashing IDs when you try to make a third item (say the About page) a child of the clashing item further down the menu:
Start with:
- About - Hello World - Uncategorized
Move About to child of Uncategorized:
- Hello World - Uncategorized ---- About
Save, and you end up with:
- Hello World ---- About - Uncategorized
Damn wiki formatting
Page - About
...Category - Uncategorized
......Page - About