grafana / influxdb-08-datasource

Data source plugin for InfluxDB 0.8.x
Apache License 2.0
6 stars 11 forks source link

Fix: Plugin broken in Grafana 4 #9

Closed wallrat closed 3 years ago

wallrat commented 7 years ago

The upgrade of Lodash in Grafana 4 broke the plugin, the third argument ('thisArg') to _.map that bound the callbacks this-contex was removed.

This commit explicitly binds the callback instead.

-- For anyone searching for this problem, this is how it apperas in the console:

boot.85c49108.js:formatted:44467 TypeError: Cannot read property '_seriesQuery' of undefined
    at eval (datasource.js?bust=1482144303665:54)
    at l (boot.85c49108.js:formatted:61524)
    at Function.Sg [as map] (boot.85c49108.js:formatted:63798)
    at InfluxDatasource.query (datasource.js?bust=1482144303665:35)
    at h.f.issueQueries (boot.85c49108.js:formatted:51727)
    at h.issueQueries (boot.85c49108.js:formatted:23224)
    at g (boot.85c49108.js:formatted:44883)
    at boot.85c49108.js:formatted:44893
    at o.$eval (boot.85c49108.js:formatted:45380)
    at o.$digest (boot.85c49108.js:formatted:45308)
tinco commented 7 years ago

I can confirm this PR solves an issue for us.

jabbors commented 7 years ago

I can also confirm that it works for Grafana4.

SSE4 commented 7 years ago

@torkelo @bergquist any update?