Allow editing of bio in user edit form

sun - June 17, 2008 - 19:46
Project:Bio
Version:5.x-1.2
Component:Code
Category:feature request
Priority:normal
Assigned:sun
Status:needs work
Description

For my current project, an for Bio in general, I think it would be great if it was possible to remove the "Biography" menu tab and display the node edit form in the user edit form.

I have already an idea how this could be accomplished via FAPI's #tree property, will follow-up later on.

#1

sun - June 18, 2008 - 06:31
Status:active» needs review

Here we go. Realized by leveraging the Subform Element module.

Also includes some performance-related fixes, for example statically caching the result in bio_for_user().

EDIT: Fixed my wrong statement above.

AttachmentSize
bio.user-edit.patch 4.44 KB

#2

sun - June 18, 2008 - 06:59

Ahem, last patch still contained some debug code. This one also removes bio node form submit buttons now.

AttachmentSize
bio.user-edit.patch 4.53 KB

#3

Johnny vd Laar - June 27, 2008 - 10:38

great just what I was looking for :D

#4

sun - June 27, 2008 - 19:19

Attached patch additionally removes the bio node menu tab if editing of bio node in the user account form is enabled.

AttachmentSize
bio.user-edit.patch 5.09 KB

#5

smk-ka - July 15, 2008 - 13:51
Status:needs review» needs work

Beware this patch breaks any ops in bio_user() except 'view' which requires the bio node's $nid, because that won't be available anymore. The statically cached $nid in bio_for_user() should respect $uid.

#6

lelizondob - November 30, 2008 - 09:58
Version:5.x-1.x-dev» 5.x-1.2

I tried to apply the patch #4 against version 1.2 but I've got Hunk #3 and #4 failed. Because I really needed this I started to copy the patch code into the latest version of the module... I'm uploading the complete bio.module file with the code attached. I tested it and it is working for me, I even use Imagecache Profiles and Register with Picture and everything is working.

The only problem I can report is the wsod I got after enabled the option "Show fields on user account edit form", but still, it worked.

If you use this file rename it to bio.module and backup your original bio.module file before doing anything.

Luis

AttachmentSize
bio.module.user-edit.txt 18.32 KB

#7

lelizondob - November 30, 2008 - 10:40

Make sure you don't enable this option before every user on the site has created a bio node because you'll get:

Fatal error: Call to undefined function bio_user_register_form() in bio.module on line 269

when trying to view the user's profile page

#8

fehin - March 6, 2009 - 20:02

The module in #6 helped me get remove the duplicate editing place but I don't like that the form is joined with the account settings page and the fact that it's way below in the form. It is possible to give it its own secondary tab under the edit tab? I currently have other tabs under that merchant profile and statitics. Please take a look at the attached image.

Thanks.

AttachmentSize
uprofile.JPG 35.59 KB

#9

lelizondob - March 7, 2009 - 02:24

I think there's a patch somewhere to to this. I must say you must be really careful when using the module in #6. One problem you'll have is that users won't be able to change their user picture.

Anyway, I don't think there's a future with this module, everybody is moving to drupal 6.x

 
 

Drupal is a registered trademark of Dries Buytaert.