Opened 9 years ago
Closed 9 years ago
#1299 closed defect (bug) (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 )
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):
- http://ru.forums.wordpress.org/topic/Вывод-последних-записей-из-каждой-категории (ID 23625)
- http://ru.forums.wordpress.org/topic/Вывод-последних-записей-из-каждой-категории-1 (ID 23627)
The former redirects to the latter.
A more recent example:
- https://ru.forums.wordpress.org/topic/На-этой-странице-обнаружена-циклическая-переад (ID 32139)
- https://ru.forums.wordpress.org/topic/На-этой-странице-обнаружена-циклическая-переад-1 (ID 47933)
- https://ru.forums.wordpress.org/topic/На-этой-странице-обнаружена-циклическая-переад-3 (ID 51736)
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)
Change History (8)
#4
@
9 years ago
Another example:
- https://ru.forums.wordpress.org/topic/cookies-заблокированы-из-за-неожиданного-вывода-на-эк-4 (53869)
- https://ru.forums.wordpress.org/topic/cookies-заблокированы-из-за-неожиданного-вывода-на-эк-5 (53871)
- https://ru.forums.wordpress.org/topic/cookies-заблокированы-из-за-неожиданного-вывода-на-эк-6 (53918)
- https://ru.forums.wordpress.org/topic/cookies-заблокированы-из-за-неожиданного-вывода-на-эк-7 (53919)
At the moment, they all redirect to someone else's year-old topic, and we can't help the new user:
#5
follow-up:
↓ 6
@
9 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)
#6
in reply to:
↑ 5
@
9 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?
Related: #1298, #1300.