I get the below warning and form error when trying to add comments to any node (story, page, etc.) on a PHP 5.04 installation (Apache2, Debian Sarge).
PHP warning:
"Warning: strtotime() [function.strtotime]: Called with an empty time parameter. in /home/msb015/projects/drupal/modules/comment.module on line 448."
Form error:
"You have to specify a valid date."
PHP5 backtrace:
#0 comment_validate(Array ([subject] => test,[comment] => test,[format] => 1,[cid] => ,[pid] => 0,[nid] => 5,[uid] => )) called at [/home/msb015/projects/drupal/modules/comment.module:396]
#1 comment_reply(5) called at [/home/msb015/projects/drupal/includes/menu.inc:354]
#2 call_user_func_array(comment_reply, Array ([0] => 5)) called at [/home/msb015/projects/drupal/includes/menu.inc:354]
#3 menu_execute_active_handler() called at [/home/msb015/projects/drupal/index.php:15]
As you can tell, there isn't a 'date' key in $edit (what's passed to comment_validate()). After some debugging with the help of killes, we managed to fix the problem with the attached patch. The patch passes 'now' to strtotime() if edit['date'] didn't exist.
| Comment | File | Size | Author |
|---|---|---|---|
| comment_15.patch | 800 bytes | michaelsb |
Comments
Comment #1
morbus iffNo patch attached.
Comment #2
morbus iffComment #3
chx commentedSomeone else was reporting this and is already fixed.
Comment #4
(not verified) commented