Opened 12 years ago
Closed 12 years ago
#30008 closed enhancement (fixed)
De-registering heartbeat script causes meta boxes to become unresponsive
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.1 | Priority: | normal |
| Severity: | normal | Version: | 4.0 |
| Component: | Script Loader | Keywords: | has-patch |
| Focuses: | javascript | Cc: |
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.
- Call
wp_deregister_script('heartbeat');on init. - Go to any post/page/cpt and try to close/open or drag a meta box (excerpt, revision, discussion, comments, etc).
Attachments (1)
Change History (8)
#3
@
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
@
12 years ago
- Milestone changed from Awaiting Review to 4.1
- Type changed from defect (bug) to enhancement
Thinking more about this: we can "decouple" heartbeat from other scripts that can work without it. In practice only autosave.js requires it.
#5
@
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
@
12 years ago
+1 for 30008.patch, I saw a request on support forums today similar to this ticket.
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.