Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 14 years ago

#2066 closed defect (bug) (fixed)

Wrong non-latin slugs (in activity stream, group names etc.)

Reported by: motomac's profile motomac Owned by:
Milestone: 1.5 Priority: major
Severity: Version:
Component: Core Keywords: cyrillic
Cc:

Description

In activity stream link "View" doesn't work, if the name of blog post or name of forum topic contains cyrillic and is long.

See here: http://testbp.org/members/motomac/

Attachments (1)

cyrillic_bug.png (22.5 KB) - added by motomac 15 years ago.

Download all attachments as: .zip

Change History (13)

@motomac
15 years ago

#1 @DJPaul
15 years ago

  • Component set to Core

How do we fix it? What should the link be?

#2 @motomac
14 years ago

For example, cyrillic string:

Проверка кириллицы. Проверка кириллицы. Проверка кириллицы. Проверка кириллицы

#3 @motomac
14 years ago

  • Summary changed from Cyrillic in the names of items in activity stream to Wrong non-latin slugs (in activity stream, group names etc.)

Simple solution is to increase limit of symbols for slugs tables in the database:
primary_link in wp_bp_activity make varchar(300), for example.

And make the same with other slug tables (group names, for example): slug in wp_bp_groups (varchar(900)).

It happens because non-latin symbols take more space then latinic (*6 times longer).

#5 @lenasterg
14 years ago

Just to config this bug for 1.2.7.
The same behavior with long Greek titles of blog posts.

#6 @DJPaul
14 years ago

Obviously the blog post slugs aren't anything to do with BuddyPress. In 1.3, activity stream character limit has gone up to 200. See the notes on #880. Activity stream view link with the example above works okay for me. Could someone give trunk the once-over and find out what other slugs still break?

#7 @SergeyBiryukov
14 years ago

200 character limit allows up to 33 non-Latin characters. It's obviously better than the previous 100 character limit (which only allowed up to 16 non-Latin characters) and probably should be enough for group slugs, however forum topic titles can be longer, I guess.

motomac's example slug is being cut, but actually works on current trunk. We just need to make sure that cutting a slug doesn't break its last symbol, like it happened in #880. From what I've tested so far, that doesn't seem to happen now.

#8 @DJPaul
14 years ago

Oh, I see. Thank you for the explanation. FYI, 200 is the magic number because that's the size of the wp_posts table 'post_name' column which is relevant because BuddyPress will be moving to custom post types in the future.

#9 @boonebgorges
14 years ago

The important thing about the 200 character limit is that it is the size used in sanitize_title_with_dashes(). As long as we allow for at least that much space, WP will make sure that the uri-encoded non-latin slug is never cut off, and is always unique. It might not make for pretty URLs all the time, but it will at least ensure that links won't break.

#10 @SergeyBiryukov
14 years ago

So if that limit will ever be increased, it should happen in WordPress, right?

#11 @boonebgorges
14 years ago

Yes, that's my understanding, though it's something that you might want to confer with the WP l18n team about.

#12 @DJPaul
14 years ago

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

Closing this as fixed per the changes made back in ticket #880

Note: See TracTickets for help on using tickets.