Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
system.module
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Jun 2008 at 12:30 UTC
Updated:
16 Sep 2008 at 01:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
samirnassar commentedIf the error is confirmed I can provide a patch.
Comment #2
hctom... while stepping through the source, I found some other strange watchdog calls:
system.module on line 1675:
I'm not sure if this is really a task to solve, but "error" is not really a got error type, isn't it? :-)
Same thing on line 1709 in system.module:
Cheers
hctom
Comment #3
Anonymous (not verified) commentedWATCHDOG_ERROR and 'error' are definitely not the same thing. The watchdog function is a hook wrapper so it depends on what system_watchdog does with it. In reviewing the api.drupal.org for this I see that the hook_watchdog example is incorrect, a) it should use watchdog_severity_levels instead of setting its own array and b) it use a variable $log instead of the $log_msg parameter that was passed to it when setting the $subject variable.
WATCHDOG_ERROR is what should be used for the severity. The lines pointed out in #2 are questionable but not necessarily wrong. I would rather see a more meaningful watchdog type than 'error' though.
This is critical because causing PHP errors while trying to log errors isn't a very good idea.
Comment #4
hctomHi @all,
here is another addition to the documentation issues mentioned by earnie. The following example line is also written with wrong arguments:
This seems to be the Drupal 5 way to send an email. In Drupal 6, the first argument has to be the module which then is followed by the mail key and also the language is missing etc. Here is the Drupal 6 function signature to compare:
Cheers
hctom
Comment #5
Anonymous (not verified) commented@hctom: I'm thinking the documentation patch needs a new issue. The documentation for the hook system is found in CVS under contributions/docs/developer. This issue can contain the patch for the system module.
Comment #6
hctom@earnie: unfortunately I cannot create patches as I cannot install a CVS client on my system :( Is there any other possibility to help making this happen?
Cheers
hctom
Comment #7
lilou commentedhttp://api.drupal.org/api/function/watchdog/7
http://api.drupal.org/api/constant/WATCHDOG_ERROR/7
Comment #8
pasquallethis should work
Comment #9
webchickI committed the patch in #7. If we could get separate issues to discuss the other items raised here, that'd be cool. :)
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.