I have a set of CCK nodes assigned as nodeprofiles for users.
All have auto node titles.
The issue appears when you submit Account Settings page.
auto_nodetitle tries to update other nodeprofile node as it passes these conditions in hook_nodeapi:
if ((auto_nodetitle_get_setting($node->type) == AUTO_NODETITLE_ENABLED) || ((auto_nodetitle_get_setting($node->type) == AUTO_NODETITLE_OPTIONAL) && empty($node->title))) {...}
Suggestion - add another check:
if ((auto_nodetitle_get_setting($node->type) == AUTO_NODETITLE_ENABLED) || ((auto_nodetitle_get_setting($node->type) == AUTO_NODETITLE_OPTIONAL) && empty($node->title))) {
//this is a bugfix to avoid title being updated when another form was submited (e.g. nodeprofile)
if ($node->form_id != $node->type . '_node_form') return;
...
}
This way we definitely know that submited form corresponds to our node type
Comments
Comment #1
fagohm, I don't understand the problem really. You have a nodeprofile integrated in your account settings, right? So of course, the title is updated when its submitted.
Comment #2
lmakarovIn my case the title of nodeprofile node was updated when Account Setting were updated, not the particular nodeprofile.
My issue was with with 2 modules using the same variable in $user object: usernode and my custom module. After this was fixed all problem disappeared.