summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-05-31 09:40:56 +0000
committerDries Buytaert <dries@buytaert.net>2004-05-31 09:40:56 +0000
commit7f08110a5e29c29812a01b9c148e52b34f3eccdf (patch)
tree3b8f757c5102baa89195a40fc9b1af0e6cef3d47 /modules/comment
parent2954836fbacfb1da67da83756f7505f61b75ba73 (diff)
downloadbrdo-7f08110a5e29c29812a01b9c148e52b34f3eccdf.tar.gz
brdo-7f08110a5e29c29812a01b9c148e52b34f3eccdf.tar.bz2
- Improved form handling.
+ Introduced two new functions: 1. form_set_error($name, $message): files an error against the form element with the specified $name. 2. form_has_errors(): returns true if errors has been filed against form elements. + Updated the form handling: 1. The form_ functions will add 'class="error"' when a form field has been found to be erroneous. 2. The error message is passed to theme_form_element() when the particular form field has been found to be erroneous. + I updated the user and profile module to take advantage of these new functions. + IMPORTANT: the _user() hook changed. The 'validate' case should no longer retun an error message when something goes wrong but should set it with form_set_error().
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index f5da756cf..832c5e979 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -281,7 +281,7 @@ function comment_post($edit) {
** Validate the comment's body.
*/
- if ($edit["comment"] == "") {
+ if ($edit['comment'] == '') {
return array(t("Empty comment"), t("The comment you submitted is empty."));
}