WordPress.org

Make WordPress Core

Opened 7 months ago

#49859 new defect (bug)

Post autosave called multiple times

Reported by: Rufus87 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.4
Component: Autosave Keywords:
Focuses: javascript Cc:

Description

Hi everyone.

I found an issue, which is mostly not related to wordpress core but the fix should be handled in wp core itself.

autosave.js works just great except one point.

If there is move than one wysiwyg editor in admin post edit screen (no matter how it is added, in my case it is created ACF plugin, but it can be just a custom meta box field implemented as wysiwyg editor field ), and there is and autosave for current post, then 'tinymce-editor-init.autosave' jquery event triggered on jQuery(document) will call checkPost() js method wysiwyg editors count times. As a result "The backup of this post in your browser is different from the version below" notice is rendered the same count times.

If there are 6 wysiwyg editors including wp native one (I have 5 custom ones), 'tinymce-editor-init.autosave' is called 6 times, and as a result "The backup of this post in your browser is different from the version below" notice is rendered 6 times.

This is very easy to reproduce.

Please review.

Thanks in advance.
Rafik I.

Change History (0)

Note: See TracTickets for help on using tickets.