Another module's cron process sets most (!) usernode comments back to 0 (disabled)
MarcoR - November 2, 2007 - 10:09
| Project: | Usernode Guestbook |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | MarcoR |
| Status: | closed |
Jump to:
Description
When all existing usernodes have been updated by usernode_comment.module to readable and writable comments (node->comment=2), the cron process sets most usernodes back to 0.
EXCEPT: There are unchanged usernodes in node table for:
- Admin (uid 1),
- wrong users with uid 0 (and therefore having no entry in users table) and
- an deleted user who still has a usernode but no entry in users table (uid 77).
I commented out cron hook in usernode module, but that made no change to that effect. So which module has a cron process that changes the comment values in usernodes?

#1
Additionally subscriptions module sends out usernode notifications each time a user object is saved. Very annoying, but gives a hint of whats going wrong here.
#2
Each time the cron process is run and another module tries to save some data to the users table, this code is run:
<?phpcase 'update':
// 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']);
?>
It was intended tp run this code only on send of the form. Operation must be 'submit' instead of 'update'.
<?phpcase 'submit':
// 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']);
?>
Will be fixed in the next 5.x-dev-version.
#3
Fixed in current development snapshot.
#4
Automatically closed -- issue fixed for two weeks with no activity.