Issue with the perm...
 
Notifications
Clear all

wpForo 1.x.x [Closed] Issue with the permalink for duplicate topic titles

5 Posts
2 Users
0 Reactions
921 Views
Posts: 22
 aung
Topic starter
(@aung)
Eminent Member
Joined: 4 years ago

When a user creates 2 topics with the same title under one forum, it successfully created and appeared in the topic list. But, we cannot access the 2nd topic as its permalink directs to the first topic.

I then looked into the issue and found that wpForo creates the same permalink for both topics. Even I can see they have a unique post number respectively, e.g.

.../community/my-forum/my-topic/#post-1
.../community/my-forum/my-topic/#post-2

- permalink of the 2nd topic always redirects to the 1st topic.

The issue was resolved when I changed the 2nd topic name to something different than the 1st topic.

I hope you may consider fixing this issue soon. Thank you.

P.s. It'll be great to give the user an alert saying something like "a similar topic title exists".

4 Replies
Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

@aung,

The second topic with the same title should be created with -2 suffix. And this is done automatically by wpForo. So let me know how are you creating topics? Are you adding it directly in database?

Posts: 22
 aung
Topic starter
(@aung)
Eminent Member
Joined: 4 years ago

Nope. I did not touch the database. I'm using the forum as a normal user, but I'm using Unicode characters in a different language. I think the issue is wpForo adds the suffix before it trims the title.

Please see below: the 1st line is the actual title, and the 2nd line is the title in the permalink that appears. You'll find the length of the actual characters of the topic title (as shown in the first line) and the length of the characters that appear in the permalink.

ပြည်တွင်းစစ် ဖြစ်နေရင် ပြည်ပက ဝင်ကူလို့ မရဘူးဆိုသူတွေ အကွက်ထဲဝင်ပြီဆိုတဲ့ ဂျင်းသမားတွေ ဖတ်ဖို့

.../community/my-forum/ပြည်တွင်းစစ်-ဖြစ်နေရင်-ပ/#post-123

As you know when I copy such an URL from a browser's address bar, the clipboard will hold the "percent-encoded" form like below:

.../community/my-forum/%e1%80%95%e1%80%bc%e1%80%8a%e1%80%ba%e1%80%90%e1%80%bd%e1%80%84%e1%80%ba%e1%80%b8%e1%80%85%e1%80%85%e1%80%ba-%e1%80%96%e1%80%bc%e1%80%85%e1%80%ba%e1%80%94%e1%80%b1%e1%80%9b%e1%80%84%e1%80%ba-%e1%80%95/

This may be a reason the topic title has been trimmed for a permalink.

If the above explains wpForo trims the title to create a permalink, the suffix should be attached to the title after trimming.

2 Replies
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10587

@aung,

The problem comes from the language, the letters of your language are encoded for URLs, and they don't allow wpForo to add -2 or -3 suffixes to the end of the duplicated topic paths, so the paths become identical and cannot be reached. There is no solution for your issue yet. We'll add this in the plugin issue list and fix it in upcoming versions.

Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10587

If you need to fix this asap, you should edit the /wp-content/plugins/wpforo/wpf-includes/class-topics.php file, find this code on the 91st line:

if(isset($slug)) $slug = sanitize_title($slug);

change it to this:

//if(isset($slug)) $slug = sanitize_title($slug);

Save it. This should help to avoid such issue with the future topic, but this will not help with the existing topics.