Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#10966 closed defect (bug) (fixed)

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

Reported by: ramiy's profile ramiy Owned by: dwright's profile 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 15 years ago.
pic2.PNG (42.7 KB) - added by ramiy 15 years ago.
category.php.diff (1.4 KB) - added by dwright 15 years ago.
wp-includes/category.php.patch file
bug-10966-issue-cat1.png (11.4 KB) - added by dwright 15 years ago.
demonstrates issue using slug of string 'internationalizætiøn'
bug-10966-issue-cat1-edit.png (11.9 KB) - added by dwright 15 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 15 years ago.
demonstrates issue using slug of string 'internationalizætiøn' (Quick Edit)
bug-10966-fix-cat1.png (4.9 KB) - added by dwright 15 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 15 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 15 years ago.
demonstrates resolution of issue using slug of string 'internationalizætiøn' (Quick Edit)
template.php.diff (3.0 KB) - added by dwright 15 years ago.
newest patch for wp-admin/includes/template.php

Download all attachments as: .zip

Change History (26)

@ramiy
15 years ago

@ramiy
15 years ago

#1 @ramiy
15 years ago

  • Component changed from General to Quick Edit

@dwright
15 years ago

wp-includes/category.php.patch file

@dwright
15 years ago

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

@dwright
15 years ago

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

@dwright
15 years ago

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

@dwright
15 years ago

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

@dwright
15 years ago

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

@dwright
15 years ago

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

#2 @dwright
15 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)

#3 @ramiy
15 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

#4 @dwright
15 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.

#5 @dwright
15 years ago

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

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

@dwright
15 years ago

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

#6 @dwright
15 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

#7 @ramiy
15 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.

#8 follow-up: @ryan
15 years ago

  • Milestone changed from 2.9 to Future Release

#9 in reply to: ↑ 8 @ramiy
15 years ago

  • Milestone changed from Future Release to 2.9

Replying to ryan:

Why "future release"?
dwright fixed this bug!

#10 @ryan
15 years ago

See also #6915

#11 @ryan
15 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.

#12 @ryan
15 years ago

  • Severity changed from critical to normal

#13 @ramiy
15 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.

#14 @nbachiyski
15 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.

#15 @ryan
15 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

#16 @ramiy
14 years ago

Related: #16999.

Note: See TracTickets for help on using tickets.