Running Acquia Drupal 1.2.6
Only the first 30 search phrases are shown and there is no pager to let you see the rest of the results. If sorting by Count (ascending instead of the default descending) or by Message (either way) the behaviour is similar - you get the right "first" page of results (as expected) but no pager. I've checked the page source and the pager is definitely not there. The other "top xxx" reports all work fine. Also works fine in 5.x.
Problem looks to be in http://api.drupal.org/api/function/dblog_top/6:
In
$result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables ". tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type);
the count query should probably be
"SELECT COUNT(DISTINCT(message, variables)) FROM {watchdog} WHERE type = '%s'"
since message is always
%keys (@type).
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | dblog_query_fix.patch | 865 bytes | Souvent22 |
| #6 | dlog-pager.png | 9.25 KB | lilou |
| #2 | dblog_top.patch | 862 bytes | gpk |
Comments
Comment #1
gpk commentedActually the count query might need to be something like:
which seems to work. There's probably a neater way of doing it i.e. without a subquery - my SQL isn't exactly cutting edge :P
Comment #2
gpk commentedNow with patch. The top page not found and top access denied reports (which also use dblog_top()) still work also with this patch.
Comment #3
gpk commentedLooks like this will affect 7.x also, which has
Comment #4
gpk commentedNo patch for 7.x.
Comment #5
lilou commentedPager works on D7 (i test it) :
Comment #6
lilou commentedComment #7
gpk commentedWhich report is that? It doesn't look like the top search phrases report.
Comment #8
lilou commented@gpk : you're right, pager only work for dblog module (admin/reports/access-denied and admin/reports/page-not-found).
Comment #9
Souvent22 commentedI'm re-rolling a patch for D6. I think this ticket is for the D6 issue, as the issue seems to be fixed for D7.
Comment #10
gpk commented>the issue seems to be fixed for D7
Ah, that must be #302268: TableSorts and PagerDefault queries broken.
Not sure that #9, which seems to be just a re-rolled #2, is the best way of fixing this in 6.x. Anyone more familiar with SQL care to chip in?
Comment #11
thedavidmeister commentedpatch doesn't apply:
error: dblog.admin.inc: No such file or directory
Regardless, I don't think this will be fixed in D6 and it's not an issue in D7+