Howdy,

can anyone please give 2 cents on this:

i'm using Nodeprofile and CCK to let new users insert their profile on first registration (the profile fields are shown directly on the registration form).

Autonodetitle is supposed to auto assign the user name to the profile node.

The problem is that at the moment of the generation of the profile node, the user does not have his name saved yet, so no title is assigned at all (i've to manually edit the profile node to get it back).

Did anyone else had this problem before? Is there a workaround at hand (using PHP as pattern of the title maybe)?

Help much appreciated! Thx

Comments

smoof’s picture

same problem here :(

Since the creator of the node is set to the new "username" (which is correct) the information seems to be available.

fago’s picture

nodeprofile sets the author information during node submit - but in this stage autonode title has already set the title.

Such special cases like this can't be handled in general. To make setting the the title automatically possibly though, I suggest adding a workflow-ng action to auto nodetitle, which allows setting the node title. This would allow you to configure overwriting the title after node creation or even in node submit.

See http://drupal.org/node/198398 for more.

marcoBauli’s picture

Status: Active » Fixed

fago thanks for supporting with this, for the moment fixed this using Logintoboggan and redirecting user to nodeprofile creation right after registration. it does the job i'd say ;)

marking as fixed

prakasht’s picture

Status: Fixed » Postponed (maintainer needs more info)

Hello
Could you please explain how to use the workflow for the node title. I have using bio content type and incorporated the bio content type into the registration form. I selected "Automatically generate the title and hide the title field' and use this pattern for title "[field_first_name][field_last_name]". But it does not work. Need help please.

Regards

fago’s picture

Status: Postponed (maintainer needs more info) » Fixed

nodeprofile != bio so this is another issue. open one, if you want.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

kriskd’s picture

I think I found a fix for this, but could use someone to double-check my work.

Like the original poster, I want to use nodeprofile/CCK on my registration page, but found that Autonodetitles didn't work in this scenario and I ended up with 'Anonymous' as the node title instead of what I had specified in the automatic node titles field.

What I did was create a profile field in the profile.module. This could be anything and I specified that it be Hidden profile field, only accessible by administrators, modules and themes and I don't have it available on the registration form so the user is never aware of it.

Now when I register on the site, I get my nodeprofile in the registration as expected and I get the correct node title based on the tokens in automatic node titles.

Could someone see if they can reproduce this?

michelle’s picture

This bit is from my tutorial... I don't remember if I got the code from somewhere or wrote it myself but I'm pretty sure it works. Replace MODULENAME with the name of whatever module you stick it into.

function MODULENAME_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  global $new_account;

  //Set the correct title for new nodes created during registration
  if ($op == 'submit' && is_nodeprofile($node->type) && isset($new_account)) {
    $node->title = $new_account->name;
  }
}

Michelle