Steps:
1. Created a new content type called 'employee'.
2. Checked "Use this content type as a nodeprofile for users".
3. On the Node Profile tab for this content type checked "Show this node profile during user registration".
4. Went to /admin/user/user and clicked Add User tab.
5. Filled out information, click submit, but receive message: The username %username% does not exist.
(If I go back to the content type and uncheck "Show this node profile during user registration" I am able to add a new user without problems.)
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | nodeprofile-207802.patch | 732 bytes | jody lynn |
Comments
Comment #1
hansrossel commentedSame problem here.
Hans
Comment #2
alanburke commentedYep, Same problem here.
Comment #3
mandclu commentedConfirmed, I have the same issue.
Digging a little further, I see that nodeprofile uses hook_nodeapi and subform_element_submit to manage this, which may be causing a timing issue. My site was able to accomplish a similar (if admittedly less complicated) task using usernode, which appears to employ drupal_execute instead. I may tinker with the code and see if I can get this approach working for nodeprofile as well.
Comment #4
mandclu commentedOK, I found something that seems to fix the issue. In the code for nodeprofile_get_register_form, on line 526 I changed the declaration for '#data_separation' to true, and now it works.
Anyone have any thoughts on other problems this might create?
Comment #5
rastarr commentedsubscribing
..... as I have this issue as well
Comment #6
alanburke commentedOk no patch as such... so no 'patch to review'.
That said,
I have made the change as outlined in #4, and it seems to work.
I haven't spotted any drawbacks at the moment, and will report if I find any.
I don't really understand formapi enough to know what 'data_separation' even means..
Regards
Alan
Comment #7
mandclu commentedI believe that 'data_separation' in this case means that in the subform (the nodeprofile) it will prepend the fields to ensure there are no collisions (fields in the nodeprofile that end up with the same name as fields in the parent's form). It's actually part of subform_element, which is why it's more obscure.
In this case it allows the nodeprofile name field to stay blank, which allows the node to pass node_validate. My concern was that in its original code nodeprofile specifically set data_separation to false, so it seemed to me that changing it would be more likely to cause problems. Like you, though, so far I haven't seen any.
Comment #8
fagoYou can change the value of #data-separation if it works for you. Previously nodeprofile shipped with data_separation == TRUE, but issues with imagefield appeared, so I changed it to FALSE. This lets even imagefield work with nodeprofile, however now there might be a name collision. E.g. if you call a CCK field "name" or "mail" this might conflict with the already existing textfields "name" and "mail" - resulting in validation errors or wrong values.
Probably I should mention that in the README.
Comment #9
alanburke commentedThere had to be a catch!
While the suggestion solution outlined in #4,
and used by as in #6,
Solves the original problem.
Sod's law prevailed eventually, and it broke another feature.
In my nodetype for nodeprofile, there is a filefield.
With this fix outlined above [ '#data_separation' to true]
the upload function breaks, with a mqsql error.
I have documented this bug here
http://drupal.org/node/208864#comment-766552
But it seems more related to this here.
When data_separation set to true, I get that sql error.
When data_separation set to false, No sql error, and the user can register properly.
But the original problem still applies now.
The inability to add a user at the user admin screen...
What to do?
Regards
Alan
Comment #10
cbovard commentedHello,
I did the change but it is causing an issue with the custom registration form.
Do not do the change "The inability to add a user at the user admin screen..."
I am going to try to set the form variable at the user admin screen: [#data_separation] => 1
Maybe this will work.
chris
Comment #11
moritzz commentedSame Issue here. Subscribing as well.
Comment #12
metareason commentedSubscribing.
Comment #13
bcn commentedtracking
Comment #14
davidtrainer commentedsubscribed
Comment #15
jody lynnThe change fixed the bug for me with the attached patch, so I can now add users. I haven't tested alanburke's filefield issue but am not having an issue with imagefield.
Comment #16
jody lynn(Try 2 for patch attachment. Not sure if d.o. is having an attachment issue lately.)
Comment #17
idmacdonald commentedI can confirm that Lynn's patch above works to fix node profile creation on the user registration form and at user/user/create.
Comment #18
fagoI just gave this a test and noticed, that there *IS* a name collision in any case - as the author's "user" input field of a node profile conflicts with the "user" name input field of the form.
So I committed a fix, which:
* sets data separation to FALSE on the register page, so imagefield keeps working there
* sets data separation to TRUE for the admin page, so one can add new users, but imagefield's probably won't work there.
Please test the next development snapshot and report back the results.
Comment #19
meeotch commentedSubscribing. I'm getting the same behavior, but don't have the leeway to thoroughly test the patch out yet - so just watching the thread.
Comment #20
jody lynnThe same problem you have with imagefield and possibly filefield also applies to date field. So now with the latest dev with data separation FALSE the date field works for the registration page but on the admin page gives massive errors.
Comment #21
fagohm, thinking again over this, the last fix wasn't 100% ideal. If fields like the imagefield are used and required, then adding users won't work again.
So, I've just removed the nodeprofile form from the user admin adding page - to add a profile for your new users, just manually add the profile node.
Comment #22
dgtlmoon commented@fago: so you've removed this functionality/behaviour from "Add a user" to fix this bug?
Sounds like a change to the kind of behaviour users already expect from this module to resolve a small bug which doesnt feel right.
Gotta be a way we can keep this?
Also - have you comitted the change you just mentioned to the current dev branch/release ?
Comment #23
node-add-matt commentedSubscribing.
Comment #24
adijeff commentedI had the same problem as the first poster, brenk28. It was caused by a permissions issue. If I enabled (in this case) "create employee content" and "edit own employee content" for all roles except anonymous the error went away.
Comment #25
aether commented+1 for returning integrated node profile to admin's Add a User form.
Comment #26
bcn commentedI'm gonna have to say I prefer it how it is now, ie leaving the node profile fields off the user add form.
There should be a way for admins to add users without having to fill out their node profiles. Hijacking the admin/user/user/create form was never ideal IMHO.
Anyway, I'm sure Fago will come up with something good, as usual...
Comment #27
fago>There should be a way for admins to add users without having to fill out their node profiles.
agreed!
Thinking about this, I don't think it's a good idea to urge admins to fill out profiles for users. Furthermore there are problems with it (read the issue..), so it will stay like it is now - no form for admins.
Comment #28
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #29
liliplanet commentedsorry, reopening. have the same problem, admin cannot add user when content_profile is available on registration.
Look forward to any resolve, and thank you.
Comment #30
macloch commentedSelecting the following under "Content Profile" tab fixes issue for me (after about 2hrs troubleshooting permissions, etc).
[ x ] Other form elements (except for required CCK fields)
Not sure what "Other form elements" is causing the issue....
My content profile includes "Text" and two "Standard group" field-definitions.
(Suspecting "Standard Group" field-type but grasping straws a bit and no more time to look into this for now.)
Comment #31
trevorforrest commentedI just discovered that i am facing the same issue with Content_Profile enabled....but I am not seeing where the suggested
[ x ] Other form elements (except for required CCK fields) section is. Is this in the Content Profile tab under the Profile Content Type ? and also is this supposed to work under DP6....Which version of Content Profile are we talking about here.
Comment #33
fagoThis is issue is *not* about content profile.