Skip to content
Snippets Groups Projects
Unverified Commit 6f4095fc authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Merge pull request #9219 from metabase/dont-explode-for-invalid-targets

Don't explode if dash params have invalid targets (#8917)
parents f5070e29 5ce1cc2d
No related branches found
No related tags found
No related merge requests found
(ns metabase.models.params
"Utility functions for dealing with parameters for Dashboards and Cards."
(:require [clojure.set :as set]
[clojure.tools.logging :as log]
[metabase
[db :as mdb]
[util :as u]]
[metabase.mbql.util :as mbql.u]
[metabase.util
[i18n :as ui18n :refer [trs]]
[i18n :as ui18n :refer [trs tru]]
[schema :as su]]
[schema.core :as s]
[toucan
......@@ -61,9 +62,13 @@
[target dashcard]
(when (mbql.u/is-clause? :dimension target)
(let [[_ dimension] target]
(field-form->id (if (mbql.u/is-clause? :template-tag dimension)
(template-tag->field-form dimension dashcard)
dimension)))))
(try
(field-form->id
(if (mbql.u/is-clause? :template-tag dimension)
(template-tag->field-form dimension dashcard)
dimension))
(catch Throwable e
(log/error e (tru "Could not find matching Field ID for target:") target))))))
(defn- pk-fields
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment