Opened 6 hours ago
Last modified 66 minutes ago
#63598 new defect (bug)
Post locking takeover dialogue shows when `show_post_locked_dialog` filter returns false
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | ui | Cc: |
Description
Follow-up to #24830.
When you attempt to avoid the post locking dialogue via show_post_locked_dialog
filter, you are initially allowed to view the post without the lock dialogue appearing, but after an autosave and the post lock is checked you are presented with the post takeover dialogue.
The first user into a post isn't presented with this, but a second user attempting to also edit will receive this.
When it was resolved in #24830, this was prior to the REST API being present, so unsure if it's related to the autosave REST API request and/or the post lock check, but the behaviour is unexpected. Hoping that someone with better knowledge of these working can help figure this out.
Attachments (1)
Change History (5)
#1
@
5 hours ago
- Summary changed from Post locking takeover dialogue shows when running `show_post_locked_dialog` filter returns false to Post locking takeover dialogue shows when `show_post_locked_dialog` filter returns false
#3
@
73 minutes ago
Looking at this more, it's the wp_refresh_post_lock
function run from the heartbeat_received
filter which is causing the issue.
#4
@
66 minutes ago
When we attempt to avoid the post locking dialogue by setting up show_post_locked_dialog
filter value to false. It will set state.postLock.isLocked
value initially to false. But when the heartbeat check returns wp-refresh-post-lock.lock_error
response, It updates both state.postLock.isTakeover
and state.postLock.isLocked
and pop up the dialogue box. But that box doesn't have any take over button.
By default takeover dialogue box look like this.
But if we set show_post_locked_dialog
filter value false. It looks like this
You will see there is no takeover button. So far the behavior looks good to me but the filter name is confusing I guess. For the classic editor, that filter behavior matches exectly as per name but for the GB editor, I think we should update the filter name.
File: wp-admin\edit-form-blocks.php - Line - 215
post takeover dialogue for 2nd user