Posted by MarcoR on November 9, 2007 at 9:01am
Jump to:
| Project: | Usernode Guestbook |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | MarcoR |
| Status: | closed (fixed) |
Issue Summary
If profile module is enabled you have probably some more sub tabs when editing the form.
If a tab different from "account settings" is submitted, the user's usernode guestbook will be deactivated (set to 0).
Comments
#1
We need to check if $edit['comment'] is part of the sent form. Will be fixed in next dev version.
<?php/**
* Implementation of hook_user().
*
* Let's have a guestbook section in the user profile.
*/
function usernode_guestbook_user($type, &$edit, &$user, $category = NULL) {
switch ($type) {
// ....
case 'submit':
if (isset($edit['comment'])) {
// Save usernode options and delete values from form array
// before usernode gets saved
$node = usernode_get_node($user);
$node->comment = $edit['comment'];
node_save($node);
unset($edit['comment']);
}
break;
}
}
?>
#2
committed into latest dev version.
#3
Automatically closed -- issue fixed for two weeks with no activity.