Opened 10 years ago
Closed 10 years ago
#27503 closed defect (bug) (fixed)
Heartbeat can cause a post slug to be generated while a title is being entered
Reported by: | nacin | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Autosave | Keywords: | needs-patch |
Focuses: | Cc: |
Description
It's possible to be in the middle of entering a post's title at the time heartbeat runs. When an autosave fires in this context, the callback attached to after-autosave.update-post-slug
fires, resulting in a slug edit box.
Thus a post title of "Autosaving is a cool thing" ended up with a slug of "autos".
This should really only happen if the post title doesn't have the focus. I'm not sure what 3.8 behavior was but I believe autosave would only start to run when a field lost the focus.
Change History (3)
#2
in reply to:
↑ 1
@
10 years ago
Replying to azaozz:
The behavior is the same in 3.8. This is somewhat mitigated by running the first autosave as soon as the title field is blurred.
Best way to fix this would be to not save the temporary permalink if the title field has focus. Then the permalink will be created (and the edit-slug-box shown) after the next autosave.
Works for me.
The behavior is the same in 3.8. This is somewhat mitigated by running the first autosave as soon as the title field is blurred.
Best way to fix this would be to not save the temporary permalink if the title field has focus. Then the permalink will be created (and the edit-slug-box shown) after the next autosave.