WordPress.org

Make WordPress Core

#23613 closed defect (bug) (fixed)

Editing permalinks cuts off the last letter

Reported by: brendanmcoffey Owned by: nacin
Milestone: 3.6 Priority: normal
Severity: normal Version: 2.5
Component: Permalinks Keywords: has-patch commit
Focuses: Cc:

Description

Whenever changing a permalink from within a page or post, if the permalink is changed from the area directly below the page/post title, and then the Update button clicked, the permalink is updated with the last character missing. If the permalink is changed and then OK is clicked, then the Update button, it updates properly.

It would be great if whenever the permalink input loses focus, it has the same result as clicking that OK button, but I suspect this is a bug that needs to be fixed anyway, so that clicking Update immediately after editing a permalink does not cut off any characters.

Attachments (1)

23613.patch (781 bytes) - added by SergeyBiryukov 14 months ago.

Download all attachments as: .zip

Change History (8)

SergeyBiryukov14 months ago

comment:1 SergeyBiryukov14 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.6
  • Version changed from 3.5.1 to 2.5

Confirmed. When keypress event is fired, this.value doesn't have the latest character yet:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/js/post.js#L619

Last edited 14 months ago by SergeyBiryukov (previous) (diff)

comment:2 SergeyBiryukov14 months ago

Has been this way since the feature was introduced in [6633].

comment:3 follow-up: toscho14 months ago

  • Cc info@… added

It is not just the last letter: If you shorten a permalink and hit update immediately, the changes are lost too, and the permalink stays as long as it was before your edit. Sometimes. Sometimes not.

comment:4 in reply to: ↑ 3 SergeyBiryukov14 months ago

Replying to toscho:

It is not just the last letter: If you shorten a permalink and hit update immediately, the changes are lost too, and the permalink stays as long as it was before your edit.

I can only reproduce it with the difference of one letter (not necessarily the last one). The cause appears to be the same: when Delete or Backspace is pressed, keypress event is fired, but this.value still contains the old value.

comment:5 SergeyBiryukov14 months ago

  • Keywords commit added

comment:6 brendanmcoffey12 months ago

I see that there is a patch for this issue.. but I have noticed that the issue still persists in the latest nightly (3.6-beta1-24041)
I'm not sure how to commit a patch like this, but just reporting that the bug still exists.

comment:7 nacin12 months ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 24059:

Wait until keyup to set the slug input on the post page, otherwise the final character is not stored. props SergeyBiryukov, fixes #23613.

Note: See TracTickets for help on using tickets.