When i attempt to save edits to an existing profile i get the following error:

This user already has a content profile of this type. You can only create one profile per user.

CommentFileSizeAuthor
#3 content_profile.patch1.44 KBKevin Rogers

Comments

tomsherlock’s picture

Priority: Normal » Critical

Not sure what happened with this issue (#543104). For some reason is was not showing up on my screen, so i created another issue (#553984) of same name with following content:

When attempting to preview my changes to a content profile (there was no 'save' button) I got the following error message:

"This user already has a content profile of this type. You can only create one profile per user."

I also have installed CCK Fieldgroup Tabs 6.x-1.x-dev installed. The tabs change visually. So there is a possibility CCK Fieldgroup Tabs is interfering with content profile.

I will submit an issue with the CCK Fieldgroup Tabs module as well.

fago’s picture

Category: bug » support

I don't think that this is related to a bug in content profile...

Kevin Rogers’s picture

Category: support » bug
StatusFileSize
new1.44 KB

I am experiencing the same problem. I have set up the content profile module, using a content type called "member". I have been able to add the member information to users profiles, but I am have trouble when editing the content.

I have tried editing the content via the user profile page (user/%user/edit/member) and directly via the node edit page (node/%node/edit). I have tried both methods with the admin account (uid and a normal user account (uid = 3).

From looking at the code, the problem occurs in the content_profile_nodeapi function. When saving changes to a content profile node it looks like the function incorrectly generates an error, based on the fact that the user already has a content profile node of this type - when in fact it should successfully save the node.

The function should only be interested in the case where there is an attempt to save a new node when a node already exists, or an existing node has its user-name changed.

I believe the attached patch corrects the behaviour.

BaskingShark’s picture

Same problem for me but the patch doesn't fix the underlying problem which I think is described in this issue: http://drupal.org/node/313135

It looks like when creating/editing a profile as an administrator the uid passed to content_profile_profile_exists and inserted into the node table is 0... which is why it keeps saying the profile already exists. Once any administrator creates a profile for any user it is written to the node table as type "profile_name" and uid "0" -- it's then inaccessible to everyone and starts blocking all further admin profile adding/editing.

I don't see the problem when a non-admin user is adding/editing his or her own profiles.

smithn.nc’s picture

Subscribe.

hansrossel’s picture

Status: Active » Closed (duplicate)