Skip to content

Commit

Permalink
fix: fall back to mixed parser if the field doesn't have a parser def…
Browse files Browse the repository at this point in the history
…ined in the url
  • Loading branch information
gtk-grafana committed Sep 19, 2024
1 parent 4e558c2 commit bf2f951
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/services/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ export function getValueFromFieldsFilter(filter: AdHocVariableFilter, variableNa
return JSON.parse(filter.value);
} catch (e) {
console.error(`Failed to parse ${variableName}`, e);

// If the user has a URL from before 0.1.4 where detected_fields changed the format of the fields value to include the parser, fall back to mixed parser if we have a value
if (filter.value) {
return {
value: filter.value,
parser: 'mixed',
};
}
throw e;
}
}
Expand Down

0 comments on commit bf2f951

Please sign in to comment.