Skip to content

Fixed redirect being overwritten#955

Merged
MKet merged 2 commits intodevelopfrom
bugfix/query_redirect_fix
Dec 12, 2025
Merged

Fixed redirect being overwritten#955
MKet merged 2 commits intodevelopfrom
bugfix/query_redirect_fix

Conversation

@HappyMaarten
Copy link
Copy Markdown
Contributor

Describe your changes

Using a redirect query to redirect to a new URL actually works now.
When using a redirect query to load a specific template, the other query columns are now added to the query string

Type of change

Please check only ONE option.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How was this tested?

Local build

Checklist before requesting a review

  • I have reviewed and tested my changes
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I selected develop as the base branch and not main, or the pull request is a hotfix that needs to be done directly on main
  • I double checked all my changes and they contain no temporary test code, no code that is commented out and no changes that are not part of this branch
  • I added new unit tests for my changes if applicable

Related pull requests

n/a

Link to Asana ticket

https://app.asana.com/1/5038780173035/project/1204297502076149/task/1212343527813505

Fixed query results not being added to QS
@HappyMaarten HappyMaarten requested a review from a team as a code owner December 11, 2025 15:19
Copy link
Copy Markdown
Contributor

@MKet MKet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some remarks for these code changes, please address them.


var dataRow = dataTable.Rows[0];
string result = null;
var dict = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give this dictionary a more descriptive name than dict. Something like queryResults or redirectResults is my suggestion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -338,28 +360,14 @@ private async Task<string> RunRedirectQuery(Template template, QueryString query
throw new Exception($"Redirect query (id {template.Id}) returned {dataTable.Rows.Count} results, expected one!");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this method is being updated anyway please update this exception to something more appropriate.
My suggestion is using an InvalidOperationException

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants