Saving a post redirects to a wrong URL after saving a post from the frontpage or user view #235

Open
opened 12 months ago by teddit · 2 comments
Owner

When saving a post from the frontpage, page redirects to:
https://teddit.net/r//hot?t=

Cannot GET /r//hot

And from the user view:
https://teddit.net/u/fluffyponyza/submitted

Redirects to: https://teddit.net/r/undefined/new?t=

When saving a post from the frontpage, page redirects to: https://teddit.net/r//hot?t= ``` Cannot GET /r//hot ``` And from the user view: https://teddit.net/u/fluffyponyza/submitted Redirects to: https://teddit.net/r/undefined/new?t=
teddit added the
bug
label 12 months ago

I looked into this to see if I introduced this regression, but it seems it was present before I changed the routes.

I tried this commit:

202514db8b

Could you confirm this?

It looks like this bug happens because in /views/components/link.pug the back_url variable is getting an extra slash added when on the homepage.

I looked into this to see if I introduced this regression, but it seems it was present before I changed the routes. I tried this commit: 202514db8bfdabf5ad511f2d181d7ce25766484c Could you confirm this? It looks like this bug happens because in `/views/components/link.pug` the `back_url` variable is getting an extra slash added when on the homepage.
Poster
Owner
 but it seems it was present before I changed the routes.

Yes, this bug happened before the routes clean-up.

I was about to fix this, but it's not as simple as I thought. The logic for the back_url doesn't support the user view either. For example, try saving a post here:
https://teddit.net/u/fluffyponyza/submitted

I will change the issue title.

``` but it seems it was present before I changed the routes. ``` Yes, this bug happened before the routes clean-up. I was about to fix this, but it's not as simple as I thought. The logic for the `back_url` doesn't support the user view either. For example, try saving a post here: https://teddit.net/u/fluffyponyza/submitted I will change the issue title.
teddit changed title from Saving a post from the frontpage gives a 404 to Saving a post redirects to a wrong URL after saving a post from the frontpage or user view 11 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: teddit/teddit#235
Loading…
There is no content yet.