From 7863be5e82ccfbaa4aa9bac2343ad9e560130b44 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 8 Oct 2005 12:21:47 +0000 Subject: - Patch #33433 by chx: fixed a number of form API problems. * Default form value * Leftover debug function in form.inc * PHP5 issue with comment date (I got this patch from another issue) * Validation error fix (was calling legacy form validate) * Lots o' warnings on comment preview * Filter tips plus argument (gremlins. I swear this was not there.) * Message to clear what's going on with system settings * Non-freetagging taxonomies fixed --- modules/comment/comment.module | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d932b6214..3be3ef28d 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -417,8 +417,9 @@ function comment_validate(&$edit) { $edit['status'] = user_access('post comments without approval') ? 0 : 1; } else { - if (strtotime($edit['date']) != -1) { - $edit['timestamp'] = strtotime($edit['date']); + $date = isset($edit['date']) ? $edit['date'] : 'now'; + if (strtotime($date) != -1) { + $edit['timestamp'] = strtotime($date); } else { form_set_error('date', t('You have to specify a valid date.')); @@ -492,8 +493,6 @@ function comment_validate(&$edit) { } } } - // verify that this submission was actually generated using a local form - form_validate($edit, 'comment'. $edit['nid'] . $edit['pid']); return $edit; } @@ -522,7 +521,7 @@ function comment_preview($edit) { if (!form_get_errors()) { $output .= theme('comment_view', $comment); } - $output .= theme('comment_form', $edit, t('Reply')); + $output .= comment_form($edit, t('Reply')); if ($edit['pid']) { $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d', $edit['pid'], COMMENT_PUBLISHED)); -- cgit v1.2.3