Watchdog arguments changed in Drupal 6

Dave Reid - August 25, 2008 - 19:40
Project:Demonstration site (Sandbox / Snapshot)
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I get the following errors only when viewing 'demo' log entries:
* warning: Invalid argument supplied for foreach() in /home/.katona/davereid20/drupal-6/includes/common.inc on line 789.
* warning: strtr() [function.strtr]: The second argument is not an array in /home/.katona/davereid20/drupal-6/includes/common.inc on line 806.

Looked into the code, the changes to the watchdog API from 5 to 6 didn't get changed in demo.module. The offending lines of code:

watchdog('demo', $message, $success ? WATCHDOG_NOTICE : WATCHDOG_ERROR);
watchdog('demo', $message, WATCHDOG_ERROR);

The third parameter should be array() and then the status code.

#1

sun - August 26, 2008 - 17:17
Status:active» needs review

Please test attached patch.

AttachmentSize
demo-DRUPAL-6--1.watchdog.patch 961 bytes

#2

sun - September 12, 2008 - 20:45
Status:needs review» fixed

Committed.

#3

Dave Reid - September 12, 2008 - 20:47

Sorry...I didn't follow up to say the patch worked fine. Thanks!

#4

Dave Reid - September 12, 2008 - 20:48

Thanks greggles! Any word on #299548: Line breaks not showing up in email?

#5

Dave Reid - September 12, 2008 - 20:50

Arg...Firefox crashed and posted that to the wrong issue queue. Sorry.

#6

Anonymous (not verified) - September 26, 2008 - 20:51
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.