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 (#788)
  • Loading branch information
gtk-grafana authored Sep 19, 2024
1 parent 7fc099d commit 12a0c68
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 @@ -158,6 +158,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 12a0c68

Please sign in to comment.