From fe2b3e7c006a607c2b9fd9a485a7bda13515a94f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 4 Jul 2004 16:50:02 +0000 Subject: - Patch by Steven and me: refactored the form handling of nodes. The node system is now using form_set_error() and friends like the rest of Drupal does. This makes for both a consistent user experience and consistent code. It simplifies the forms and validation code, however, it does change the node API slightly: * The _validate hook and the _nodeapi('validate') hook of the node API (1) no longer take an 'error' parameter and (2) should no longer return an error array. To set an error, call form_set_error(). * The _form hook of the node module no longer takes a form hook and should not worry about displaying errors. Ditto for _nodeapi('form_post') and _nodeapi('form_pre'). --- modules/comment/comment.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 0c56e9929..cf7771212 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -316,7 +316,7 @@ function comment_post($edit) { $edit['subject'] = truncate_utf8(strip_tags($edit['comment']), 29); } - if (!form_has_errors()) { + if (!form_get_errors()) { // Check for duplicate comments. Note that we have to use the // validated/filtered data to perform such check. @@ -1255,7 +1255,7 @@ function theme_comment_form($edit, $title) { $form .= form_submit(t('Preview comment')); } - if (!form_has_errors()) { + if (!form_get_errors()) { $form .= form_submit(t('Post comment')); } -- cgit v1.2.3