Simple patch which resets $_SESSION['dblog_overview_filter']
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ) subquery' at line 2: SELECT COUNT(*) AS expression FROM (SELECT w.wid AS wid, w.uid AS uid, w.severity AS severity, w.type AS type, w.timestamp AS timestamp, w.message AS message, w.variables AS variables, w.link AS link, u.name AS name, 1 AS expression FROM {watchdog} w LEFT OUTER JOIN {users} u ON w.uid = u.uid WHERE (()) ) subquery; Array ( [0] => stager ) in PagerDefault->execute() (line 75 of /opt/cvs/drupal/includes/pager.inc).
Notice: Undefined index: type in dblog_build_filter_query() (line 200 of /opt/cvs/drupal/modules/dblog/dblog.admin.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | dblog_clear_log.patch | 1.63 KB | swentel |
| #6 | dblog_clear_log.patch | 1.62 KB | swentel |
| dblog_clear_log.patch | 849 bytes | swentel |
Comments
Comment #1
swentel commentedTagging on dblog.module
Comment #2
swentel commentedBot is happy - simple patch, can go in imho.
Comment #3
webchickNo tests for the dblog filters? Tsk, tsk.
Should be pretty easy to do; and there should be examples in user/content filter tests.
Comment #4
swentel commented@webchick: there are filter tests, see function testFilter(). Should I add an extra test to make sure this specific php/db error doesn't happen anymore ?
Comment #5
webchickYep, there should be a test that tries clearing the log, and should fail without this patch and pass with it.
Comment #6
swentel commentedOk, here goes. Test clears the database log and looks for the confirmation message.
Without the patch in dblog.admin.inc you get 2 exceptions: 1 notice and 1 PDOException.
Comment #7
Stalski commentedNice work, working like a charm
Comment #8
webchickLooks good, with the exception that we usually do assertText() for interface text rather than assertRaw (for HTML and other weird things).
Could you quickly re-roll with that change and set back to RTBC?
Comment #9
swentel commentedOk, rerolled, I'll let the bot test first and will set it to RTBC in a few minutes.
Comment #10
swentel commented- edit - testbot happy - RTBC
Comment #11
webchickCommitted to HEAD. Thanks!