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

Field filter breaks native question on dashboard #40383

Closed
zbodi74 opened this issue Mar 20, 2024 · 0 comments · Fixed by #40535
Closed

Field filter breaks native question on dashboard #40383

zbodi74 opened this issue Mar 20, 2024 · 0 comments · Fixed by #40535
Assignees
Labels
.Escalation Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Parameters & Variables Filter widgets, field filters, variables etc. Querying/ .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Milestone

Comments

@zbodi74
Copy link

zbodi74 commented Mar 20, 2024

Describe the bug

Field filters break native question on a dashboard

To Reproduce

  1. Create a native question: sample database, select * from products where {{ title }}, set the variable type to Field Filter, wire it to Products.Title.
  2. Save it, add to a dashboard.
  3. Add a dashboard filter and wire it to Title.
    4(!) Set a value for the title, and see the error
image

.../query api response: "error": "Error compiling HoneySQL form: These SQL clauses are unknown or have nil values: :case-sensitive",

Expected behavior

It should work.

Logs

.../query response: query_response.json

Information about your Metabase installation

Appears to be broken on stats as of 2024-03-20 / 4eea910, 1.48.8, 1.48.9 and 1.49.0.

Severity

P1

Additional context

No response

@zbodi74 zbodi74 added Type:Bug Product defects Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/GUI Query builder catch-all, including simple mode .Needs Triage .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Escalation Querying/Parameters & Variables Filter widgets, field filters, variables etc. Querying/ .Team/DashViz Dashboard and Viz team and removed .Needs Triage Querying/GUI Query builder catch-all, including simple mode labels Mar 20, 2024
@perivamsi perivamsi added .Team/QueryProcessor :hammer_and_wrench: and removed .Team/DashViz Dashboard and Viz team labels Mar 20, 2024
snoe added a commit that referenced this issue Mar 22, 2024
Fixes #40383

If a native query parameter is set up with a string widget type that
supports a `case-sensitive` option, and that parameter is tied to a
dashboard filter that did not support that option, the option was still
leaking into the filter as an option where options were not expected.

For instance the native query parameter used `string/contains` and the
dashboard used `string/=`, the QP would try to build a filter like `[:=
field value {:case-sensitive false}]` which is an illegal filter.
snoe added a commit that referenced this issue Mar 25, 2024
Fixes #40383

If a native query parameter is set up with a string widget type that
supports a `case-sensitive` option, and that parameter is tied to a
dashboard filter that did not support that option, the option was still
leaking into the filter as an option where options were not expected.

For instance the native query parameter used `string/contains` and the
dashboard used `string/=`, the QP would try to build a filter like `[:=
field value {:case-sensitive false}]` which is an illegal filter.
@snoe snoe added this to the 0.49.2 milestone Mar 25, 2024
github-actions bot pushed a commit that referenced this issue Mar 25, 2024
Fixes #40383

If a native query parameter is set up with a string widget type that
supports a `case-sensitive` option, and that parameter is tied to a
dashboard filter that did not support that option, the option was still
leaking into the filter as an option where options were not expected.

For instance the native query parameter used `string/contains` and the
dashboard used `string/=`, the QP would try to build a filter like `[:=
field value {:case-sensitive false}]` which is an illegal filter.
metabase-bot bot added a commit that referenced this issue Mar 26, 2024
* Fix case-sensitive option leaking to string/= (#40535)

Fixes #40383

If a native query parameter is set up with a string widget type that
supports a `case-sensitive` option, and that parameter is tied to a
dashboard filter that did not support that option, the option was still
leaking into the filter as an option where options were not expected.

For instance the native query parameter used `string/contains` and the
dashboard used `string/=`, the QP would try to build a filter like `[:=
field value {:case-sensitive false}]` which is an illegal filter.

* Fix moved fn

---------

Co-authored-by: Case Nelson <case@metabase.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Escalation Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Parameters & Variables Filter widgets, field filters, variables etc. Querying/ .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants