Admin link in subfolder mode is incorrect

When I grant admin access, the link that gets sent in the e-mail is incorrect. Instead of being:

http://mysite/forum/path/to_confirm

it is:

http://mysite/path/to_confirm

5 Likes

This might be a valid sub folder bug @neil?

Yes, the code is explicitly using the no-subfolder URL: base_url_no_prefix :face_with_raised_eyebrow: I’ll fix.

EDIT: fixed

8 Likes

Possible the same problems:

  1. on badges notifications - incorrect url
  2. on FAQ button - it returns wrong location, so it’s not possible to return from FAQ url back to the forum.
3 Likes
  1. click here to unsubscribe” in digest email is incorrect too.
4 Likes

Thanks @Ivan_Rapekas. I fixed the unsubscribe link in digest email, and found that the “About” link was wrong here:

But the FAQ one is correct there and in hamburger menu. Where did you find the FAQ button with the wrong url?

This is an example of hard-coded URLs in our translation files, which is something we need to stop doing.

4 Likes

Hi @neil , thank you for the fast reply and actions!
I found that emails may contain wrong url or not, it depends on the kind of notification. For example:

  1. email with [forum name] Summary in the subject has incorrect URL
  2. email with [forum name] [category] topic name in the subject has correct URL
  3. email with [forum name] [PM] Backup completed ... in the subject has correct URL
  4. email with [forum name] [PM] Data export ... in the subject has correct URL

I meant FAQ button from the menu, but the same problem can be reproduced in the /about section.

My forum works in the folder /discuss. I set external URLs for all buttons here: <base_url>/discuss/about

изображение

  1. If I click FAQ link, it redirects me to <some_external_url>. When I click ‘Back’ button in the browser, get endless 302 redirect. When I click ‘Back’ button again, it returns me to forum as I expected in the previous step.
  2. If I left-mouse click Terms of Service link from the picture above the first time, it redirects me to correctly to <external_tos_url>
  3. But when I click to Guidelines first and then to TOS link, it redirects me to /discuss/terms-of-use page,which does not exist in my case.
  4. Privace section has the same problem. In other words, it’s unable to access TOS and Privacy from Guidelines page.

Sorry for my Joda-style english :slight_smile:

3 Likes

Wrong URL in badge, missed folder:

Summary

изображение

Summary

1 Like

Which url in the email is incorrect?

About the other problem, I can see it happening on your site but can’t reproduce it unfortunately.

I’ll fix some of the other links.

Another subfolder bug: All links starting with /my are broken in subfolder.

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/url.js.es6#L195-L196

4 Likes

Here it is:
изображение

Currently I resolve this using .htaccess rules.

2 Likes

Hi, there is another issue with subfolder.

My website is located at https://www.example.com
The forum is located at https://www.example.com/discuss

I made a custom html header in the default theme:
<a href="https://www.example.com/faq">FAQ</a>

When I click the link in my header, it redirects me to
https://www.example.com/discuss/faq instead of https://www.example.com/faq

It seems, that Discourse handles external links in custom header as part of forum.

I fixed that unsubscribe link.

For your custom html header, you’re using a route that the exists in the Discourse app, so the javascript is handling it. Maybe adding target='_blank' to that link would work, or change it to a path that’s different that one of Discourse’s routes.

1 Like

But, shouldn’t Discourse detect only route changes for https://www.example.com/discuss/ paths? Why does it react on changes with https://www.example.com/ prefix ?

The same problem persists for all our menus, including, for instance, https://www.example.com/case-studies that does not exist in discourse as a route. In this case Discourse opens https://www.example.com/discuss/case-studies on click by link and shows 404 Page “Oops! That page doesn’t exist or is private”.

2 Likes