Problem/Motivation
If a third argument is passed to watchdog() that is not NULL or an array, the dblog page at admin/reports/dblog fails with a fatal error. This is because bad data is saved in the serialized 'variables' column in the watchdog table, and is not checked before passing to t() in dblog_overview()
Proposed resolution
Type hint the third argument to watchdog() as array.
Remaining tasks
None. Documentation has now been added, and a fix is committed to D8.
User interface changes
No UI changes.
API changes
Any calls to watchdog() that want to set a $severity level, but do not have $variables arguments for t() interpolation, have to pass array() instead of NULL as the third argument to watchdog().
No API changes. watchdog() will now throw an error if anything other than an array or NULL is given as the 3rd argument to the function.
Original report by cam8001
Recoverable fatal error: Argument 2 passed to t() must be an array, string given, called in /var/www/example.com/modules/dblog/dblog.admin.inc on line 265 and defined in t() (line 1451 of /var/www/example.com/includes/bootstrap.inc
A contrib module passed some bad arguments to watchdog(), the data was saved to the watchdog table, then passed to t() for display at admin/reports/dblog. t() fails on the bad data, and now I cannot view logs at admin/reports/dblog.
I can get around the issue and restore the page's functionality by deleting the offending rows from the watchdog table.