TASVideos / tasvideos

The code for the live TASVideos website
https://tasvideos.org/
GNU General Public License v3.0
62 stars 29 forks source link

Add/Merge additional params on return urls #1911

Closed Masterjun3 closed 3 months ago

Masterjun3 commented 3 months ago

Resolves the bug where we would redirect to a page with two ?, breaking the query.

To recreate the bug

That's the bug, there are two ? in that final link. Only the first ? counts, so the query sets GameId to 2356?GameId=2356.

~~After this PR the final link will look like /Submissions/Catalog/7251?GameId=2356&GameId=2356&GameVersionId=4820. Notice how there are still two GameIds, but it works (and query string expliticly allow multiple settings of the same value).~~

After this PR the final link will look like /Submissions/Catalog/7251?GameId=2356&GameVersionId=4820.

adelikat commented 3 months ago

I like this approach, and the code looks good

vadosnaprimer commented 3 months ago

I'll test locally and call back.

vadosnaprimer commented 3 months ago

If I create game and version, they get properly selected. The baseline goal is created automatically, so I can just select it and save. But if I need to create a different goal and I hit Manage, game version gets unselected.

Masterjun3 commented 3 months ago

Technically the Manage button is unrelated to this PR. But I found the reason this happens. It's because our javascript doesn't encode the return url properly. I can make a commit that fixes that as well.

vadosnaprimer commented 3 months ago

Thanks! (it's fixed indeed)