Active
Project:
Content Profile
Version:
6.x-1.0
Component:
Base module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2008 at 03:01 UTC
Updated:
9 Sep 2015 at 12:00 UTC
Jump to comment: Most recent
When an Administrator create a new user - the profile is being stored in the database with uid = 0 and revision_uid = admin uid. I tried to play with module weight in system table with no success. within hook_user() the $account object represents the new user correctly, but hook_nodeapi() sees $user as currently logged in user (administrator).
Also would like to point that hook_nodeapi() gets called before hook_user() - meaning $account is empty at the profile creation page.
Could someone confirm that they have fully functioning module when admin creates a new user?
Also a note to the module author to look into the problem.
Comments
Comment #1
piyushbagri commentedsubscribe
Comment #2
prhodes commentedYes, I am experiencing this same issue myself.
Subscribe+
Update:
Using content_profile-6.x-1.x-dev
NO record inserted at all in the content_type_profile table.
Comment #3
fago>When an Administrator create a new user
Are you talking about the registration integration or what?
Comment #4
BaskingShark commentedSame issue, discovered when unable to save edits as described in http://drupal.org/node/543104
Here's my description from that bug: 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.
Comment #5
ivrh commentedTo #3. Not sure what you mean about registration integration. I am administrator and I create a new user. This is when the problem happens. The module works fine for new users registering themselves.
Comment #6
ivrh commentedChange status
Comment #7
rickh commentedI'm having the same problem here. Admin can't create new profiles, authenticated users can create an account perfectly but when any editing or adding of profiles is done by the administrator the account becomes anonymous. Has there been any solutions on this yet? I'm a bit stuck so any help would be appreciated.
Thanks
Comment #8
rickh commentedany help on this guys?
Comment #9
bentonboomslang commentedSubscribing (there seem to be a number of threads with this problem). It seems a pretty important one.
Comment #10
hansrossel commentedI had the same problem and could solve it as follow:
My setup:
- profile information is requested on user registration, so user and profile get created in the user/register form
- anonymous users can create profile content (set in permissions): I start doubting if thats needed, but thought so because its an anonymous user registering and completing the profile data on user/register
Problem as above:
- when an admin creates a new user+content profile on admin/user/user/create there is the error "This user has already a content profile of this type. You can only create one profile per user". Admins cannot create users anymore.
Cause:
- I found in the logs one user that registered and that had during the registration (so on the same minute) created two content profiles: one correctly assigned to the user as author and a second one with the same data but assigned to anonymous as author. I suppose this user was not very patient and pressed the submit button a second time during registration which caused the second wrong content profile being created.
Solution:
- Deleting the wrong/corrupt content profile (assigned to anonymous) that the impatient user had created solved the issue. Apparently that content profile is blocking all other user/profile creation when it exists.
I'm wondering if the permission to create a content profile for anonymous users might have made this possible to happen.
Comment #11
rickh commentedHow can you not give an anonymous user the permission to create a profile, when you have a social networking style site. I cannot create every profile, because i want users to create their own. Maybe I'm not completely understanding this, but any help would be appreciated.
Comment #12
hansrossel commentedA content profile is a content type that has a certain user as author, so it should not be made by anonymous users. When first a user registers and then in the next form creates his content profile there is no problem and we don't need to give permissions to anonymous users to create content profiles. The user is at the moment he creates the content profile an authenticated user.
When the permission "create content profile" is given to anonymous users a user that is not logged in can go to node/add/[name-of-contentprofile] and make a profile that is not connected to any user (= that is owned by "anonymous").
What happened in the double submit is that such a profile is created, so I think not giving anonymous users the permission to create a content profile could prevent this from happening. So I'm curious if the others that have this issue also have given permission to anonymous users to create a content profile.
Comment #13
rickh commentedYou are absolutley right, but I never had the pemission set for anonymous users. This has also not affected the above for me at all. It brought back my anonymous user pictures but has had no affect on admin being able to edit or add profiles, including their own.
Comment #14
hansrossel commented@rickh: could you confirm you also have 1 content profile that is assigned to Anonymous (which is uid=0, I'm not sure which anonymous user pictures you talk about), and that if you delete that one an admin can again create content profiles for users?
Comment #15
rickh commentedi don't have permissions set so that anonymous users can create profiles and admin cannot create any profiles as they become anonymous profiles. I do believe this might be a problem with the realname module, as the option is not given to create a username for the user, when the profile is cretead. I believe the realname module is making things go a bit nuts, therefore i'm of no help to you further. sorry about that. thanks for the help, but I think we are on two different levels here.
Comment #16
hansrossel commentedI'm not using realname, in my case it was just one wrong/corrupt content profile blocking the creating by admins. Removing that one solves all problems.
Just disable Realname module and see if it works then if you think it's that module. If it works again when disabling the realname module, you better go to that issue queue with your bug, there seem to be quite a bit bugs allready there: http://drupal.org/project/issues/realname?categories=bug.
Comment #17
YK85 commentedsubscribing
Comment #18
johnlutzsubscribing
Comment #19
fagoI just created manually a profile assigned to the anonymous users and test adding a new user with the profile-creation form added. It worked fine for me though. Any steps to reproduce? Also please make sure to test the latest dev snapshot.
Setting priority to "normal" as that feature isn't that common.
Comment #20
u4yk commentedI run into this issue when I try to update a content profile using a custom form. Now, when I use the base form, it works fine; it's just when I use a custom form, it sets the uid to 0 and the title to an empty string in the node table. Anyone have a solution?
Comment #21
agogo commentedfago: I do not agree that this issue should be prioritized as normal.
Several issues are mentioned above but the main and original issue, as I can see it, still is this:
When logged in as administrator (ex. uid 1) and creating a user profile node for any other user than him/her self -> the node uid field sets to zero (0) instead of the user id of the intended user.
This makes it impossible to create user content profiles for an administrator.
Ive taken a look at the code for the module and believe the function content_profile_form_alter() in content_profile.module should work. Looking further i made it work by just changing the author form value that is changed for administrators:
File: content_profile.module
Function: content_profile_form_alter()
On line 283:
From:
$form['author']['name']['#default_value'] = $user->name;To:
$form['author']['name']['#value'] = $user->name;Since the change is so trivial I didnt make a patch, I hope thats ok this time.
Comment #22
julien.reulos commentedAs admin, when i created a new user (with the Content Profile User Registration module activated), the user was created, but the Content Profile module node was not saved.
I apply the patch #21 and now it is working. Thanks Agogo!
Comment #23
YK85 commentedsubscribing - had the same issue. Thanks for the fix!!
Comment #24
fago>$form['author']['name']['#default_value'] = $user->name;
I don't see a problem with that approach, maybe another module is chiming in and causing your problem? Do you see the right author name in the form?
Also, please always roll proper patches.
Comment #25
damienmckennaI'm experiencing this on a website. In my case the user account is not created but the content profile node is created with the uid of 0.
Comment #26
anaperes commentedHello
I have this problem as well and I tried to used fix Agogo gave and didn't work for me.
I'm using drupal 6.2; content profile 6x-1.0; cck 6x-2.9; compact forms 6x-1.3. I saw in another issue similar to this case and they said could be form filter I also don't have.
Help please??
Regards.
Comment #27
millenniumtreeI had this issue because I wasn't printing the $form['author'] field to the page in my theme's node form template.
I made the patch in post #21, which did help me fix the problem, but it turned out to be NOT NECESSARY once I fixed my node_form.tpl.php!
Check the node_form.tpl.php file in your template and make sure you haven't done anything weird with it. In my case, I was condensing several fields into a fieldset called 'Advanced', but I had made a mistake which prevented the fields from printing.
Here's what my node_form.tpl.php looks like. I had mistakenly not printed the results of "drupal_render($form['author'])".
Comment #28
aaronbaumanReplicated OP on 6.x-beta4 and confirmed fixed in 6.x-1.0
millenniumtree I think you have run into a separate issue.
Comment #30
rofsky commentedFago, I still have this problem, on 1.0 and dev.
When editing a profile node logged in as super admin everything works fine, when logged in as another user with admin role, the node profile goes in as a guest and is not attached to the user.
Tried #21, does not fix, in dev code the line for that would be 276.
Any ideas?
----------------------
Update
Ok, After further testing, I noticed that if the form filter module is hiding the author field this happens. I still have the above change from #21 applied, and when displaying the author info everything is fine.
Do you think this is something to submit into formfilter?
Comment #31
beneetha commentedI am facing the same issue....I have created profile using profile2 module. But when admin creates profile the data is not coming proper. Shows blank when the user loggs in .............Any solution???