Download & Extend

A user's guestbook will be deactivated if user updates other profile tabs

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

Assigned to:Anonymous» MarcoR
Status:active» reviewed & tested by the community

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

Title:A user's questbook will be deactivated if user updates other profile tabs» A user's guestbook will be deactivated if user updates other profile tabs
Status:reviewed & tested by the community» fixed

committed into latest dev version.

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.