WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5492 closed defect (bug) (fixed)

Upgrade to jQuery 1.2.x

Reported by: ryan Owned by: filosofo
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Attachments (3)

jquery.diff (118.6 KB) - added by ryan 6 years ago.
ie7_jq122_sortable_fix.diff (909 bytes) - added by filosofo 6 years ago.
jquery-1.2.2-final.diff (57.2 KB) - added by filosofo 6 years ago.

Download all attachments as: .zip

Change History (28)

comment:1 ryan6 years ago

The quick add box for cats disappears with 1.2.1.

[Exception... "'type property can't be changed' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]

comment:2 filosofo6 years ago

jQuery 1.2.2 is in beta but will probably come out this week. Since that's well before WP 2.4, could we test against that instead?

comment:3 ryan6 years ago

That's fine. Either way we need to fix 1.2 compat. Only problem I've seen so far is the cat quick add.

comment:4 ryan6 years ago

$ is not a function
http://localhost/trunk/wp-admin/js/custom-fields.js?ver=20070823
Line 30

comment:5 zamoose6 years ago

#4952 predates this ticket, but since this has the most recent patch associated with it, I'd suggest closing the older one.

comment:6 filosofo6 years ago

Here's the latest beta of jQuery 1.2.2. It sounds like a full release is coming very soon.

comment:7 zamoose6 years ago

Are we still using Prototype for anything in the admin interface? If not, we should just remove the jQuery.noConflict() call at the end of source:trunk/wp-include/js/jquery/jquery.js. That way, jQuery can claim its rightful place as possessor of $() and ryan's bug would go away.

*grin*

comment:8 filosofo6 years ago

no conflict has been fixed in trunk jQuery, which is soon to be v. 1.2.2

comment:9 zamoose6 years ago

Ahhh, excellent.

Still, I thought we were trying to remove all Prototype/Script.aculo.us stuff from the WP admin in favor of jQuery...?

comment:10 ryan6 years ago

We are trying to move everything to jquery, but there are still parts that haven't made it over.

comment:11 ryan6 years ago

With 1.2.2b2, which includes the noConflict fix, we get this:

[Exception... "'type property can't be changed' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "<unknown>"  data: no]

Line 0

form.post_title has no properties
http://localhost/trunk/wp-includes/js/autosave.js?ver=20070306
Line 6

[Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: file:///Applications/Firefox.app/Contents/MacOS/components/nsSessionStore.js :: sss_saveState :: line 1749"  data: no]
file:///Applications/Firefox.app/Contents/MacOS/components/nsSessionStore.js
Line 1749

comment:12 ryan6 years ago

  • Summary changed from Upgrade to jQuery 1.2.1 to Upgrade to jQuery 1.2.x

comment:13 ryan6 years ago

Duh, forgot to add back noConflict(). Now errors look like this:

[Exception... "'type property can't be changed' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "<unknown>"  data: no]

Line 0

[Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: file:///Applications/Firefox.app/Contents/MacOS/components/nsSessionStore.js :: sss_saveState :: line 1749"  data: no]
file:///Applications/Firefox.app/Contents/MacOS/components/nsSessionStore.js
Line 1749

Autosave and the cat add box are broken.

comment:14 filosofo6 years ago

  • Owner changed from anonymous to filosofo

ryan6 years ago

comment:15 ryan6 years ago

FWIW, here's a patch with a build from current jquery svn.

comment:16 filosofo6 years ago

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

Everything seems to be fine with nightly jQuery and noConflict.

We can reopen if people are still getting errors.

Please note: the jquery-nightly.js linked to from jQuery's download page doesn't seem to actually be the nightly; you'll have to build your own (or use Ryan's patch).

comment:17 filosofo6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Oops, I should probably not close the ticket 'til jQuery 1.2.2 is released and added to WP.

comment:18 ryan6 years ago

Looks like the errors are gone now that we ported everything on the write post page to jquery. I'll commit the latest jquery from svn. We can leave the ticket open until 1.2.2 final is released and committed.

comment:19 ryan6 years ago

(In [6561]) jQuery 1.2.2b2. see #5492

comment:20 alexrabe6 years ago

Keep in your mind that jQuery 1.2.x causes problems with Interface 1.2 under IE7. My plugin (NextGEN Gallery) and also the new WordPress widget uses the sortable function from the interface lib. When I tested this with IE7 , the widget will not work proper or crashed. Under FF2 / Safari it's ok so far...

Interface is not longer developed and signed as "deprecated", not sure if jqueryUI is already on the same stage.

comment:21 filosofo6 years ago

I think alexrabe is referring to the problem with IE7 in Interface and jQuery 1.2+ where a sortable becomes un-sortable after being dragged. I've attached a patch that should fix that issue.

comment:22 mdawaffe6 years ago

Widget Sortables patch seems fine (haven't tested, but I'm trusting). I'm annoyed at the need though.

The 1.0 release of jQuery.UI doesn't seem to be compatible with jQuery.noConflict() (which I suggest we keep). Trunk versions of jQuery.UI seem to be broken at the moment. None of their example pages have a working Sortable example (at least in FF).

Does anyone have any experience with jQuery.UI?

comment:23 filosofo6 years ago

jQuery 1.2.2 final has come out, so let's get it into core. Patch attached with no-conflict appended.

http://jquery.com/blog/2008/01/15/jquery-122-2nd-birthday-present/

http://docs.jquery.com/Release:jQuery_1.2.2

filosofo6 years ago

comment:24 ryan6 years ago

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

(In [6618]) jQuery 1.2.2 final. Props filosofo. fixes #5492

comment:25 darkdragon6 years ago

  • Milestone changed from 2.6 to 2.5
Note: See TracTickets for help on using tickets.