Opened 11 years ago
Closed 11 years ago
#23055 closed defect (bug) (fixed)
New Menu Items Add a Mystery 0 below
Reported by: | Ipstenu | Owned by: | |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Menus | Keywords: | dev-feedback |
Focuses: | Cc: |
Description
Action: Go to add a new item to any menu.
Expected Outcome: New Item is added.
Actual Outcome: New item is added with a 0 below.
This weird 0 vanishes on save, but happens no matter what kind of menu item you try to insert. I can't reproduce this on 3.5, only on Trunk. The 0 shows under each new item until you save.
Attachments (2)
Change History (16)
#2
@
11 years ago
- Keywords has-patch added
Introduced along with jQuery 1.9 Beta 1 in [23180].
23055.patch appears to fix this.
#3
@
11 years ago
- Cc mdhansen@… added
I think Sergey's patch may be more appropriate but wanted to point out the cause and provide an alternative. The die( 0 ); in admin-ajax.php may be used by other requests but I am not sure.
#5
@
11 years ago
- Keywords close added; has-patch removed
[23293] fixed it for me. Is there a reason this is still open?
#6
@
11 years ago
- Keywords close removed
I'd like to learn what changed in jQuery 1.9 to cause this 0 to suddenly appear.
#8
@
11 years ago
- Cc dave@… added
Not a 1.9 issue per se. Narrowed it down to jquery-migrate.js. Without jquery-migrate, this returns the same results in jQuery 1.8.3 and 1.9.1:
> jQuery('<li>test</li>0') [<li>test</li>]
but when jquery-migrate is loaded, 1.9.1 returns:
> jQuery('<li>test</li>0') [<li>test</li>, "0"]
#9
@
11 years ago
Opened a ticket with jquery-migrate detailing what's going on and how it's different from what's happening inside vanilla jQuery: https://github.com/jquery/jquery-migrate/issues/27
#10
@
11 years ago
- Keywords needs-patch added
We need to get a fix or a workaround for this in current trunk.
Edit: Cancel that. I think it was an incompatible plugin I was testing on the menus accordion on #23450.
#12
@
11 years ago
I imagine at least a few plugins that die(0) are going to start having problems. Not much core can do about that except get the word out.
#13
@
11 years ago
- Keywords dev-feedback added
The jquery-migrate team committed a patch to strip out leading & trailing text outside tags in a string. Also adds the warning "$(html) HTML string has stray text after last tag" and test cases.
https://github.com/jquery/jquery-migrate/commit/c8147a3ba66cc50a05ae09ffa3d3f3df811f30ae
Issue is closed on their end. jquery-migrate should probably be upgraded in WP.
Confirmed.