summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-21 14:48:59 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-21 14:48:59 +0000
commit9c72e9209a7dc95c3ea88f0ff644196bda84c93e (patch)
tree4ee402b61519708172a8fbb1eae3872214f70471 /modules/comment/comment.module
parentb4435decef6ebbfa2c5e9da23c2916fca3b04f57 (diff)
downloadbrdo-9c72e9209a7dc95c3ea88f0ff644196bda84c93e.tar.gz
brdo-9c72e9209a7dc95c3ea88f0ff644196bda84c93e.tar.bz2
- Patch #334826 by maartenvg: editing of anonymous comments was broken. Bugfix with test\!
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 4730dc0a3..7394eaa52 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -787,7 +787,7 @@ function comment_save($edit) {
$edit['timestamp'] = REQUEST_TIME;
}
- if ($edit['uid'] === $user->uid) { // '===' Need to modify anonymous users as well.
+ if ($edit['uid'] === $user->uid && isset($user->name)) { // '===' Need to modify anonymous users as well.
$edit['name'] = $user->name;
}
@@ -795,7 +795,7 @@ function comment_save($edit) {
->fields(array(
'nid' => $edit['nid'],
'pid' => empty($edit['pid']) ? 0 : $edit['pid'],
- 'uid' => empty($edit['uid']) ? 0 : $edit['uid'],
+ 'uid' => $edit['uid'],
'subject' => $edit['subject'],
'comment' => $edit['comment'],
'format' => $edit['comment_format'],
@@ -1466,7 +1466,7 @@ function comment_form(&$form_state, $edit, $title = NULL) {
);
$form['uid'] = array(
'#type' => 'value',
- '#value' => !empty($edit['uid']) ? $edit['uid'] : NULL,
+ '#value' => !empty($edit['uid']) ? $edit['uid'] : 0,
);
// Only show the save button if comment previews are optional or if we are