graphite-project / graphite-web

A highly scalable real-time graphing system
http://graphite.readthedocs.org/
Apache License 2.0
5.89k stars 1.26k forks source link

[BUG] cannot load old dashboards after upgrading to 1.1.8 #2711

Closed JohnHay closed 1 year ago

JohnHay commented 3 years ago

After upgrading from 1.1.7 to 1.1.8, I could not open my old dashboards. They were still listed in the finder, but nothing loaded when selecting one of them. Trying to save a new one, also silently failed. Looking in the debugger in the browser, there was an error that htmlEncode was not found.

Adding Ext.util.Format. in front of htmlEncode in dashboard.js fixed it for me, but I don't know if that is the best way:

<snip>
--- content/js/dashboard.js.orig    2021-04-19 07:24:42.000000000 +0200
+++ content/js/dashboard.js 2021-08-21 18:44:16.285913000 +0200
@@ -3009,8 +3009,8 @@

     document.title = name + ' - Graphite Dashboard';
     changeHash(name);
-    navBar.setTitle(htmlEncode(name + ' - (' + dashboardURL + ')'));
-    saveButton.setText(htmlEncode('Save "' + name + '"'));
+    navBar.setTitle(Ext.util.Format.htmlEncode(name + ' - (' + dashboardURL + ')'));
+    saveButton.setText(Ext.util.Format.htmlEncode('Save "' + name + '"'));
     saveButton.enable();
   }
 }
</snip>

My system is FreeBSD 13.0, python3.8 and django 2.2.4.

deniszh commented 3 years ago

Hi @JohnHay

I think that's aftermath of https://github.com/graphite-project/graphite-web/pull/2620 Not sure is your fix is proper and will work for other users, though. Maybe @DanCech or @ploxiln knows better...

ploxiln commented 3 years ago

That's odd, because htmlEncode() is a global function in that js file, and used in a bunch of other places just like that.

I haven't used graphite in a while, but I'll get it set up and try to reproduce this ...

JohnHay commented 3 years ago

I see I neglected to specify the browsers I used. I used firefox 91.0.1 and chromium 91.0.4472.164. Here are screenshots of their debug consoles:

graphite-firefox graphite-chrome

ploxiln commented 3 years ago

Aha, I see - that PR was made against the master branch, and in the master branch, htmlEncode() is a global function in that file, but in the 1.1.x branch it is not there. So when this was cherry-picked back for the 1.1.8 release, this function was missing. This commit in particular I think was never backported to the 1.1.x branch: https://github.com/graphite-project/graphite-web/commit/1e72eee041a1ea780a2686b1a12336d4aa1961eb

deniszh commented 3 years ago

Ooh, that's wrong. Master currently should not diverge from 1.1.x. I will backport it then. Thanks, @ploxiln !

deniszh commented 2 years ago

Fix will be released in 1.1.9 soon

deniszh commented 1 year ago

Fix released in 1.1.10