1. Created a sample bio for an "admin" user
2. Tried to create a bio for another user "John Doe" using admin account -- filled out info, changed "Authored By" to be "John Doe", and hit "Preview"
3. Get error message "This user already has a biography. Edit it here or assign this entry to another user".
Expected functionality: admin users (admin node permission) should be able to create bios for other users merely by editing the "Authored By" field before submit.
I'm trying to figure out if this could be used for a more advanced "Author" module. See http://dev.bryght.com/t/wiki/AuthorModule for more details (think newspapers etc. where there might be one or more authors, which don't necessarily map to usernames).
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | admin_edit.patch | 855 bytes | Crell |
| #10 | bio-admin-exempt.patch | 931 bytes | webchick |
Comments
Comment #1
bradlis7 commentedI think this is fixed, because I have done so with the newest version.
Comment #2
andrewgearhart commentedI have also experienced this. I'm logged in as user 1 and I can't add a bio for another author by changing the author field.
Comment #3
smikey commentedI'm getting this error as well. Can't create a separate bio for other users. I changed the "authored by" settings as well to the person whose bio I was creating, and still the same error. Is this a matter of updating to the cvs version? Guess I'll find out...
Comment #4
smikey commenteddon't think the cvs version is updated from the 4.7 version. any suggestions?
Comment #5
csc4 commentedI think this is a manifestation of the same problem.
I edited a bio as admin which had already been created by the user and now the user gets access denied unless I give them admin privileges.... the uid on the node is the user's not the admin's so I'm really puzzled.
Comment #6
csc4 commentedI think it's something to do with node revisions - I didn't used to have revisioning on and I have a feeling it worked then and doesn't now?
Comment #7
stroobl commentedI'm quite sure this used to work with the Drupal 5 version, but since I updated to a new revision, it seems to be broken again.
Any ideas for a fix?
Comment #8
webchickYeah, this is no fun. I'll try and work out a fix.
Comment #9
webchickGrrr. What an annoying problem!
So the simple fix for this is just to exempt users with administer nodes permissions during the validate stage. And that would be just peachy, except that that doesn't stop them from (intentionally or not) creating two bios for the same user.
nodeapi op validate, for some reason, doesn't "get" the fact that you've changed the author: so this:
is always passing in the current logged in user ID; not the one in the actual authored by textarea.
Comment #10
webchickAh-ha.
But it does know about $node->name. :)
This should do it.
Comment #11
stroobl commentedIndeed, it works now.
Thanks!
Comment #12
wmostrey commentedFrom what I can see, it doesn't work. I still get the error "This user already has a Contact." with a link to the currently logged-in user.
The validation does pass when I use this:
Since arg(1) will always contain the uid of the user you're trying to edit. So validation passes, but the bio is still created for the currently logged-in user..
Comment #13
wmostrey commentedA bit more info:
When a user has no bio yet, the $node->uid and $node->name are always that of the currently logged-in user.
So even if the validation passes by using arg(1), the account is created for the logged-in user.
Comment #14
Crell commentedI was able to fix this by changing the form_alter to specify arg(1) as the author ID. The form validates and submits correctly in my brief testing. I've attached a patch.
Comment #15
jjeff commentedCommitted Crell's patch.
Thanks.
Comment #16
(not verified) commentedComment #17
chadchandler commentedThis problem has crept it's way back into the latest version of Bio, just slightly different.
Admin user's can't edit/create their own profile.
I've installed, reinstalled the adv. profile module using bio 3-4 times, and also in between manually deleted the tables from the modules in SQL. Anyways, exact same issue I believe so posting here. I apologize in advance if this in incorrect.
Comment #18
Crell commentedThis issue is LONG closed. Please open a new issue, and reference this one if you feel it's appropriate to do so. Thanks.