Needs work
Project:
Drupal core
Version:
main
Component:
dblog.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jun 2010 at 18:13 UTC
Updated:
26 Oct 2022 at 14:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonI see the problem. The "top" report sorts by the 'message' field of the {watchdog} table.
The search entries all have the same message:
Searched %type for %keys.
So I think sorting by message should be turned off for this type of report. It is meaningless, given that the message uses variable substitution to compose what the UI would see as the message.
This is function dblog_top() in modules/dblog/dblog.admin.inc for future reference.
Comment #2
jhodgdonHere's a patch.
There was an additional bug in this function: the count query was wrong -- the main query was grouping on (message, variables), but the count query was only counting distinct(message).
So... This loses some functionality for the Top Access Denied and Top Page Not Found reports. For them, it probably makes sense to use a table header sort. But for the generic case, where the on-screen-displayed message is a substitution of variables into message, sorting by the message field doesn't work in the UI.
Maybe there should be two functions, one that does table sort and one that doesn't? Anyway, this patch doesn't...
Comment #3
jhodgdon#2: 830642-nosort-topreport.patch queued for re-testing.
Comment #4
dagmarThis is valid for D8 too.
Comment #15
quietone commentedThis is still valid.
.
Comment #16
ameymudras commentedWas able to replicate the issue on 9.5.x, used reference from #2 to create a patch. Couldn't generate an interdiff
Comment #18
dagmarI'm afraid this fix won't be compatible with Drupal using SQLITE. There is no
CONCATfunction there.Comment #19
dagmarHm... Maybe it is supported somehow by the Drupal layer.
Drupal\Driver\Database\sqlite\Connection::sqlFunctionConcatbut anyways this needs tests, and specially run them against Sqlite.