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

Make sure queries have options and parameters #4952

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

gabrieldutra
Copy link
Member

What type of PR is this? (check all applicable)

  • Bug Fix

Description

Bug
Queries without parameters in their options break Public Dashboards.

Example: Dashboard/Public Dashboard

Cause

It's straightforward to understand that we rely on that Array for the Parameters functions to work. However, two questions intrigued me: "Why it fails only with Public Dashboards?" and "Why it started happening only now?"

So, the answers:
Previously what "guaranteed" that queries would have the parameters array before executing functions was this line:

this.query.options.parameters = this.query.options.parameters || [];

On #4736 we removed the check for an existing query text that, specifically for Public Dashboards (don't have a query text), would also prevent parameters from being updated. Moving the line I mentioned a few lines above would also fix the problem, but I preferred to make sure queries had that from the constructor.

Related Tickets & Documents

--

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

--

@gabrieldutra gabrieldutra force-pushed the fix-queries-without-parameters branch from 3e70e15 to 2ab5327 Compare June 7, 2020 17:08
@gabrieldutra gabrieldutra self-assigned this Jun 8, 2020
@gabrieldutra gabrieldutra merged commit 77e8d70 into master Jun 9, 2020
@gabrieldutra gabrieldutra deleted the fix-queries-without-parameters branch June 9, 2020 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants