Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#30008 closed enhancement (fixed)

De-registering heartbeat script causes meta boxes to become unresponsive

Reported by: wycks Owned by: azaozz
Priority: normal Milestone: 4.1
Component: Script Loader Version: 4.0
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description

Using

wp_deregister_script('heartbeat');

Causes the metabox fields under the default editor to not close on click and they are not draggable. Tested on WordPress 4.0 twenty-twelve and several other themes.

Steps to reproduce.

  1. Call wp_deregister_script('heartbeat'); on init.
  2. Go to any post/page/cpt and try to close/open or drag a meta box (excerpt, revision, discussion, comments, etc).

Attachments (1)

30008.patch (2.1 KB ) - added by azaozz 12 years ago.

Download all attachments as: .zip

Change History (8)

#1 @DrewAPicture
12 years ago

  • Component GeneralScript Loader
  • Focuses javascript added

#2 @azaozz
12 years ago

Happens because post.js (containing most of the JS for the Add/Edit Post screen) requires heartbeat.js. If the latter doesn't exist, the former is not loaded.

We probably can change that requirement, however heartbeat is needed for autosave, auth-check, post locks, etc. Deregistering it will disable all of them. If the purpose is to reduce AJAX requests, opened #29779 for a better way.

Thinking this should be 'wontfix' in favor of #29779.

#3 @wycks
12 years ago

It's a bit of an odd situation when these components are coupled together, one would not expect the heartbeat to effect elements not directly related to heartbeat. We recently just reduced requests by changing the timer instead of deregistering the script, I just found it odd it would cause that bug. Feel free to close.

#4 @azaozz
12 years ago

  • Milestone Awaiting Review4.1
  • Type defect (bug)enhancement

Thinking more about this: we can "decouple" heartbeat from other scripts that can work without it. In practice only autosave.js requires it.

@azaozz
12 years ago

#5 @azaozz
12 years ago

  • Keywords has-patch added

In 30008.patch:

  • Remove 'heartbeat' dependency for post.js and inline-edit-post.js. They can function correctly (with reduced functionality) when heartbeat is not loaded.
  • Fix dependencies for autosave.js.

#6 @SergeyBiryukov
12 years ago

+1 for 30008.patch, I saw a request on support forums today similar to this ticket.

#7 @azaozz
12 years ago

  • Owner set to azaozz
  • Resolutionfixed
  • Status newclosed

In 29989:

Script-loader: remove 'heartbeat' dependency for post.js and inline-edit-post.js, fix dependencies for autosave.js. Fixes #30008

Note: See TracTickets for help on using tickets.