Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/Merge additional params on return urls #1911

Merged
merged 5 commits into from
Jul 5, 2024

Conversation

Masterjun3
Copy link
Collaborator

@Masterjun3 Masterjun3 commented Jul 4, 2024

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

To recreate the bug

  • go to Submission Catalog
  • click New next to Game to create a new game, enter some stuff, and Save
  • you get redirected back, notice you're now on a url like /Submissions/Catalog/7251?GameId=2356
  • click New next to Game Version to create a new version, enter some stuff, and Save
  • you get redirected back again, notice you're now on a url like /Submissions/Catalog/7251?GameId=2356?GameId=2356&GameVersionId=4820

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.

@Masterjun3 Masterjun3 marked this pull request as draft July 4, 2024 21:04
@Masterjun3 Masterjun3 marked this pull request as ready for review July 4, 2024 22:03
@Masterjun3 Masterjun3 marked this pull request as draft July 4, 2024 22:07
@adelikat
Copy link
Collaborator

adelikat commented Jul 5, 2024

I like this approach, and the code looks good

@vadosnaprimer
Copy link
Collaborator

I'll test locally and call back.

@vadosnaprimer
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link
Collaborator

vadosnaprimer commented Jul 5, 2024

Thanks! (it's fixed indeed)

@Masterjun3 Masterjun3 marked this pull request as ready for review July 5, 2024 17:36
@adelikat adelikat self-requested a review July 5, 2024 19:45
@adelikat adelikat merged commit d1a71bc into main Jul 5, 2024
1 check passed
@adelikat adelikat deleted the returnurl-additionalparam-merge branch July 5, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants