Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#23613 closed defect (bug) (fixed)

Editing permalinks cuts off the last letter

Reported by: brendanmcoffey's profile brendanmcoffey Owned by: nacin's profile 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 11 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
11 years 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 11 years ago by SergeyBiryukov (previous) (diff)

#2 @SergeyBiryukov
11 years ago

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

#3 follow-up: @toscho
11 years 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.

#4 in reply to: ↑ 3 @SergeyBiryukov
11 years 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.

#5 @SergeyBiryukov
11 years ago

  • Keywords commit added

#6 @brendanmcoffey
11 years 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.

#7 @nacin
11 years 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.