WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 3 years ago

#1299 closed defect (fixed)

Some forum topics with long Cyrillic slugs cannot be opened

Reported by: SergeyBiryukov Owned by:
Milestone: Priority: normal
Component: International Forums Keywords:
Cc:

Description (last modified by SergeyBiryukov)

Sometimes there are topics with similar slugs, but only one of them can be opened, because the second one redirects to the first one, or vice versa.

And old example (but it happens with recent topics too):

The former redirects to the latter.

A more recent example:

The first two redirect to the last one.

This becomes confusing:

  • You can't just delete the duplicate topic. Whichever one remains, redirects to a 404 page.
  • Most of the time it's not a duplicate, but a legitimate question from different people (as in the second example), and a redirect to someone else's topic is unexpected and violates the forum rules.

Should be fixed with the upgrade to bbPress 2.x. This ticket is just for tracking and reference.

Attachments (1)

resolve-topic-slug-collisions.php (1.3 KB) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (8)

#2 @SergeyBiryukov
4 years ago

  • Description modified (diff)

#3 @SergeyBiryukov
4 years ago

  • Description modified (diff)

#5 follow-up: @ocean90
3 years ago

The reason for the redirects is that the slug is used as a cache key in get_topic() which exceeds the maximum memcached key size of 250 chars.

The slug itself is already 250 chars:

string 'cookies-%d0%b7%d0%b0%d0%b1%d0%bb%d0%be%d0%ba%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d1%8b-%d0%b8%d0%b7-%d0%b7%d0%b0-%d0%bd%d0%b5%d0%be%d0%b6%d0%b8%d0%b4%d0%b0%d0%bd%d0%bd%d0%be%d0%b3%d0%be-%d0%b2%d1%8b%d0%b2%d0%be%d0%b4%d0%b0-%d0%bd%d0%b0-%d1%8d%d0%ba-6' (length=250)

https://bbpress.trac.wordpress.org/browser/branches/1.0/bb-includes/functions.bb-topics.php?marks=10,34#L5

#6 in reply to: ↑ 5 @SergeyBiryukov
3 years ago

Replying to ocean90:

The reason for the redirects is that the slug is used as a cache key in get_topic() which exceeds the maximum memcached key size of 250 chars.

Thanks! I was able to reproduce the issue on a local bbPress 1.x install with Memcached.

resolve-topic-slug-collisions.php is a bbPress 1.x plugin that uses the bb_repermalink filter to pre-resolve topic slugs to IDs in order to bypass the bb_topic_slug cache group in get_topic().

It uses md5() of the slug as a cache key and another cache group, bb_topic_slug_md5, to avoid the length issue, so get_topic() gets a numeric ID and does not have to resolve the slug itself.

I've tested it successfully on my install. Any chance to test and deploy it on Rosetta?

#7 @ocean90
3 years ago

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

Fixed in [dotorg11479].

Note: See TracTickets for help on using tickets.