Passing an empty value in the querystring results in an error because of conversion to null
Describe the problem
You can set one or more querystring parameters on a page in the application builder. If you fill in these parameters to a form (record selector element) and open a second page on form submission, it converts empty elements to a null
value. This conversion results in an error when the parameter is intended to be numeric and if used to filter a data source. A beter solution here is to simply ignore parameters that do not have a value and not pass them in the querystring.
Steps to reproduce
- Restore the Project Tracker template
- Create a new application
- Create a page that has a query string parameter project which is numeric.
- Create a form in the homepage with a record selector that shows all the projects
- When submitting the form, it opens the second page and gets all the tasks for the selected project using the querystring
- Test it when a project is selected. Everything works well
- Test it with an empty project
Actual result
The error message Value 'null' is not a valid integer or convertible to an integer.
is shown. Refreshing the page just shows that there is a server error. This is because the querystring should be a numeric value.
Expected result
When there is no value set for the parameter, the parameter should be left out of the querystring so that it is ignored on the page.
Environment
- Operating System: Mac
- Web Browser: Chrome
- Deployment Type: docker
- Baserow Version: 1.31