I have been wondering why my users haven't been posting Bio content and I have just found out why -- and this is rater worrying.

basically, normal users when they click the Bio tab they can enter whatever text as they wish. But when they hit submit it gives them a warning message "This user already has a Bio. Edit it "here" or assign this entry to another user."
And when they click "here" it takes them to Access denied page. On mouseover I noticed that the link on "here" goes to node/64/edit , which made me suspect that it could be a "Usernode" problem. I uninstalled Usernode, but the problem persisted. (I did not delete the user nodes themselves , though)

Administrator can edit his own bio as he likes.

Do you know what could be the reason behind this error?

Comments

dldege’s picture

I'm having some problems with this and its related to the bio node not being deleted when a user is deleted. Later under conditions I have not fully figured out new users are somehow pointed to this bio creating this error message. Here's the code that makes the check.


function bio_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { 
  if ($node->type != variable_get('bio_nodetype', 'bio')) return;

  switch ($op) {
    case 'validate':
      // This user already has a bio node and this isn't it
      $account = user_load(array('name' => $node->name));
      $nid = bio_for_user($account->uid);
      if ($nid && ($nid != $node->nid)) {
        form_set_error('name', t('This user already has a @bio. Edit it <a href="@link">here</a> or assign this entry to another user.', array('@bio' => node_get_types('name', $node), '@link' => url('node/'.$nid.'/edit'))));
      } 
      break;
  }
}

It has something to do with the node not existing for the user to the user_load() on $node->name returns the anonymous user and thus the profile for the anonymous user (the one from previous deleted user).

Confusing...

csc4’s picture

Could this be an issue with duplicate/blank node names?

$account = user_load(array('name' => $node->name));

Maybe changing to

$account = user_load(array('uid' => $node->uid));

would help?

o4tuna’s picture

First, a big thank you to the people responsible for putting this module together. It looks like it can be very useful.

I'm getting this error, too. It could be that I'm trying to do something that the developers wanted to prevent, though.

I'm an administrator that needs to add multiple bios. My goal is to create a "meet our staff" page. I want a bio page for each staffer, but I really don't want a typical user to be able to create a bio.

So, I thought I (the administrator) could just input the bios myself. I got one bio input alright, but after that the module would throw this error message: "This user already has a Bio . . . "

My guess is that most businesses would be trying to use the Bio module like I am. Who wants to wait around for their staff to log in, create an account, supply their own photo, and on top of all that--input their bio? Sure, it would be nice. If your staff happens to be a crackerjack team of computer wizards, I suppose it could happen. But when you need to have a "meet our staff" page up in a hurry . . . and most of your staff can barely type . . . and you want the photos and prose on the page to have a certain sense of cohesiveness and uniformity . . . well, it just makes sense for the guy responsible for the site being right (the administrator) to input the bios himself.

Creating an account for each staffer may be a work-around. But there are cases (and my situation is one of them) where you don't want your staffers to have an account. You still need their bios on your website, though.

It makes sense that a given user could only create one bio. And it would be nice to grant a user the ability to create/edit a bio based on his assigned role. For example, a "customer" could not create a bio but a "staff member" could.

That said, why can't an administrator create bios as he sees fit?

Since I'm a novice with Drupal this "flaw" may be nothing more than a case of me showing my ignorance. However, since I'm confident that many businesses out there would like to have a "meet our staff" page on their site, I'm hoping that bringing this up will either yield some clarity or produce a resolution, making life easier for the next pilgrim who travels this vale.

Meanwhile, I sure could use some guidance on this. The only idea I have for making it work is to actually create an account for each staff member. Is there a better way?

Rob_Feature’s picture

Any movement on this issue?

I think the hack in #2 worked...but I'm no programmer, so I'm looking for confirmation that it actually fixes the problem...

prakasht’s picture

I am getting this error while submitting my bio node.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/prakash/public_html/profile/includes/form.inc on line 853.
Am I doing anything wrong?

jyork’s picture

When you are submitting a new bio, below the cck fields are several drop-down menus, for Menu settings, Comment settings, etc., and one for Authoring Information. I have been getting around this issue by opening the drop-down menu and changing the Authored by: field to the login name of the person I want to create the bio for. When I submit, a new bio is created for that person, no matter who I am logged in as.

Allie Micka’s picture

Status: Active » Closed (duplicate)

I'm fairly certain that this is a duplicate of an old issue. The behavior was that all of the bio nodes were owned by the anonymous user, so only the first entry actually got saved (but with the wrong uid). Please make sure that you're using the latest version of Bio.

Thanks!