WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#10966 closed defect (bug) (fixed)

bug: Post Slug in Quick-Edit mode for non-english languages

Reported by: ramiy Owned by: dwright
Milestone: 2.9 Priority: high
Severity: normal Version: 2.9
Component: Quick/Bulk Edit Keywords: has-patch needs-testing 2nd-opinion
Focuses: Cc:

Description

I use WP in hebrew.

When i edit posts using "Posts Edit SubPanel", i see the Slug in hebrew letters (pic1.png).

When i edit posts using "Quick Edit" the Slug shows gibberish letters (pic2.png).

Please fix this annoying bug.

Attachments (10)

pic1.PNG (45.5 KB) - added by ramiy 5 years ago.
pic2.PNG (42.7 KB) - added by ramiy 5 years ago.
category.php.diff (1.4 KB) - added by dwright 5 years ago.
wp-includes/category.php.patch file
bug-10966-issue-cat1.png (11.4 KB) - added by dwright 5 years ago.
demonstrates issue using slug of string 'internationalizætiøn'
bug-10966-issue-cat1-edit.png (11.9 KB) - added by dwright 5 years ago.
demonstrates issue using slug of string 'internationalizætiøn' (edit mode)
bug-10966-issue-quick-edit.png (27.3 KB) - added by dwright 5 years ago.
demonstrates issue using slug of string 'internationalizætiøn' (Quick Edit)
bug-10966-fix-cat1.png (4.9 KB) - added by dwright 5 years ago.
demonstrates resolution of issue using slug of string 'internationalizætiøn'
bug-10966-fix-cat1-edit.png (11.3 KB) - added by dwright 5 years ago.
demonstrates resolution of issue using slug of string 'internationalizætiøn' (edit mode)
bug-10966-fix-quick-edit.png (26.6 KB) - added by dwright 5 years ago.
demonstrates resolution of issue using slug of string 'internationalizætiøn' (Quick Edit)
template.php.diff (3.0 KB) - added by dwright 5 years ago.
newest patch for wp-admin/includes/template.php

Download all attachments as: .zip

Change History (26)

@ramiy5 years ago

@ramiy5 years ago

comment:1 @ramiy5 years ago

  • Component changed from General to Quick Edit

@dwright5 years ago

wp-includes/category.php.patch file

@dwright5 years ago

demonstrates issue using slug of string 'internationalizætiøn'

@dwright5 years ago

demonstrates issue using slug of string 'internationalizætiøn' (edit mode)

@dwright5 years ago

demonstrates issue using slug of string 'internationalizætiøn' (Quick Edit)

@dwright5 years ago

demonstrates resolution of issue using slug of string 'internationalizætiøn'

@dwright5 years ago

demonstrates resolution of issue using slug of string 'internationalizætiøn' (edit mode)

@dwright5 years ago

demonstrates resolution of issue using slug of string 'internationalizætiøn' (Quick Edit)

comment:2 @dwright5 years ago

  • Cc david_v_wright@… added
  • Keywords has-patch needs-testing 2nd-opinion added

What I understand this issue to be:

This issue demonstrates that the slug displays to the user in it's (url) encoded form.

The slug is used in urls.

http://www.faqs.org/rfcs/rfc1738.html

URLs are written only with the graphic printable characters of the
US-ASCII coded character set. The octets 80-FF hexadecimal are not
used in US-ASCII, and the octets 00-1F and 7F hexadecimal represent
control characters; these must be encoded.

So, while the slug appears to the end user as 'gibberish letters' it is actually the
(properly) encoded version of the string.

To resolve this issue, display the slug to the user decoded.
(i.e. so it looks like it did when they created it)

I don't know Hebrew, so to recreate this issue, I set the slug to name that contains non US-ASCII characters.

Categories -> Category Name (testing) -> Category Slug (internationalizætiøn)

see attached before and after screen shots.

see attached patch files

these changes 'work', I'm just not sure it's the most appropriate/elegant solution, someone more familiar with the code base should review. (I believe I have added the necessary keywords)

comment:3 @ramiy5 years ago

It needs more work.

the slug problem exists in:

  • Post Edit - wp-admin/edit.php
  • Tag Edit - wp-admin/edit-tags.php
  • Page Edit - wp-admin/edit-pages.php
  • Category Edit - wp-admin/categories.php
  • Link Category Edit - wp-admin/edit-link-categories.php

comment:4 @dwright5 years ago

  • Owner set to dwright
  • Status changed from new to accepted

Post Edit - wp-admin/edit.php

  • can't recreate. not sure how, what is 'Post Edit'? 'Quick Edit' displays slug correctly for me

Can you provide a screen shot or steps for how to recreate the issue?

Tag Edit - wp-admin/edit-tags.php

  • confirmed, displays incorrectly, I can fix this.

Page Edit - wp-admin/edit-pages.php

  • where? 'Quick Edit' displays slug correctly for me Can you provide a screen shot or steps for how to recreate the issue?

works for me:
Category Edit - wp-admin/categories.php

  • displays slug correctly for me Can you provide a screen shot or steps for how to recreate the issue?

Link Category Edit - wp-admin/edit-link-categories.php

  • displays incorrectly, will fix this.

comment:5 @dwright5 years ago

see template.php.diff "newest patch for wp-admin/includes/template.php"

should resolve:
Tag Edit - wp-admin/edit-tags.php

@dwright5 years ago

newest patch for wp-admin/includes/template.php

comment:6 @dwright5 years ago

see template.php.diff "newest patch for wp-admin/includes/template.php"

should resolve: Link Category Edit - wp-admin/edit-link-categories.php

Again, more information needed to address:

Post Edit - wp-admin/edit.php

Page Edit - wp-admin/edit-pages.php

Category Edit - wp-admin/categories.php

comment:7 @ramiy5 years ago

Lets summarize your edit in wp-admin/includes/template.php file:

  • Tag Edit - _tag_rows() function fixed
  • Category Edit - _cat_row() function fixed
  • Link Category Edit - link_cat_row() function fixed
  • Post Edit - line_edit_row() function fixed (Quick Edit Mode)
  • Page Edit - line_edit_row() function fixed (Quick Edit Mode)

i think you fixed all the problems. needs-testing.

comment:8 follow-up: @ryan5 years ago

  • Milestone changed from 2.9 to Future Release

comment:9 in reply to: ↑ 8 @ramiy5 years ago

  • Milestone changed from Future Release to 2.9

Replying to ryan:

Why "future release"?
dwright fixed this bug!

comment:10 @ryan5 years ago

See also #6915

comment:11 @ryan5 years ago

Right now all enhancements are being moved out of 2.9 in preparation for release. I'll see if the i18n maintainer wants to make this an exception though.

comment:12 @ryan5 years ago

  • Severity changed from critical to normal

comment:13 @ramiy5 years ago

Both #6915 and #10966 fix the same bug for non english languages in post slug using 'editable_slug' filter.

#6915 fixed:

  • wp-admin/includes/post.php
  • wp-admin/edit-link-category-form.php
  • wp-admin/edit-tag-form.php
  • wp-admin/edit-category-form.php

#10966 fixes:

  • wp-includes/category.php
  • wp-admin/includes/template.php

Ticket #6915 did not fix all the slug problems. In ticket #10966 dwright fexed few more slug bugs.

comment:14 @nbachiyski5 years ago

The template.php.diff last patch looks good.

Any time a slug is saved it goes through urlencode (which isn't actually needed, but that's another discussion), so this patch won't break any existing slugs.

comment:15 @ryan5 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [12277]) Apply editable_slug filter in more places. Props dwright. fixes #10966

comment:16 @ramiy4 years ago

Related: #16999.

Note: See TracTickets for help on using tickets.