Two bugs with usernames starting with subfolder name

Setup:

  • subfolder install on /forum
  • able to reproduce both on v2.5.4 and tests-passed
  • a user called forumadmin

The user profile should be visible at /forum/u/forumadmin/summary
However, when this URL is requested, a Javascript redirect is issued to /forum/uadmin/summary, i.e. /forum is being removed from the middle of the URL.

Related but different issue:
When editing a user with a username starting with forum, pressing Save on the Name field results in a 404 not found, because a PUT request to /u/forumadmin.json is being made, instead of to /forum/u/forumadmin.json. So here the subfolder is being removed, but only when the username starts with the subfolder name.

I am completely unfamiliar with Ember routing so further investigation did not succeed. I vaguely recall seeing a similar bug a few weeks ago.

6 Likes

We have this assigned out now, but fair warning it may take a month to get this sorted depending on workloads.

For an immediate work around I guess we can just ban forum... as a username if the subfolder is forum at least that is a trivial fix compared to the ember routing changes.

7 Likes

Completely understand that this is an edge case within an edge case so I wasn’t expecting this to get on top of the high priority stack :wink:

I’m not sure if the workaround is necessary, it’s not like anything will catch fire.

6 Likes

Fixed with that PR

https://github.com/discourse/discourse/pull/11786