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).

Comments

swentel’s picture

Component: base system » dblog.module

Tagging on dblog.module

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Bot is happy - simple patch, can go in imho.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

No tests for the dblog filters? Tsk, tsk.

Should be pretty easy to do; and there should be examples in user/content filter tests.

swentel’s picture

@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 ?

webchick’s picture

Yep, there should be a test that tries clearing the log, and should fail without this patch and pass with it.

swentel’s picture

Status: Needs work » Needs review
StatusFileSize
new1.62 KB

Ok, 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.

Stalski’s picture

Status: Needs review » Reviewed & tested by the community

Nice work, working like a charm

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Looks 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?

swentel’s picture

StatusFileSize
new1.63 KB

Ok, rerolled, I'll let the bot test first and will set it to RTBC in a few minutes.

swentel’s picture

Status: Needs work » Reviewed & tested by the community

- edit - testbot happy - RTBC

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Needs tests

Automatically closed -- issue fixed for 2 weeks with no activity.