Module: check_mk
Branch: master
Commit: a26e4e610908cb98554ae9d92d19528c0c29603d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a26e4e610908cb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 2 08:20:37 2016 +0100
3974 FIX Sorting comments in hover menu of comments icon by time now
---
.werks/3974 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/icons/builtin.py | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/3974 b/.werks/3974
new file mode 100644
index 0000000..425d21c
--- /dev/null
+++ b/.werks/3974
@@ -0,0 +1,10 @@
+Title: Sorting comments in hover menu of comments icon by time now
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i2
+Date: 1478071210
+
+
diff --git a/ChangeLog b/ChangeLog
index 7ca5610..b367a71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,7 @@
* 3969 FIX: CentOS 5.5: Fixed incompatibility with the available OpenSSL 0.98...
* 4037 FIX: Fix graphs that have optional metrics...
* 3973 FIX: Backup: Fixed displaying wrong finish time after backup completion
+ * 3974 FIX: Sorting comments in hover menu of comments icon by time now
WATO:
* 3915 User access times: New icon when never logged in; New column "last
seen"
diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py
index e8ed731..284f02e 100644
--- a/web/plugins/icons/builtin.py
+++ b/web/plugins/icons/builtin.py
@@ -550,7 +550,7 @@ def paint_comment_icon(what, row, tags, host_custom_vars):
comments = row[what + "_comments_with_extra_info"]
if len(comments) > 0:
text = ""
- for c in comments:
+ for c in sorted(comments, key=lambda x: x[4]):
id, author, comment, ty, timestamp = c
comment = comment.replace("\n", "<br>")
text += "%s %s: \"%s\" \n" % (paint_age(timestamp, True,
0, 'abs')[1], author, comment)