Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | uprofile.JPG | 35.59 KB | fehin |
#6 | bio.module.user-edit.txt | 18.32 KB | lelizondo |
#4 | bio.user-edit.patch | 5.09 KB | sun |
#2 | bio.user-edit.patch | 4.53 KB | sun |
#1 | bio.user-edit.patch | 4.44 KB | sun |
Comments
Comment #1
sunHere 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.
Comment #2
sunAhem, last patch still contained some debug code. This one also removes bio node form submit buttons now.
Comment #3
Johnny vd Laar CreditAttribution: Johnny vd Laar commentedgreat just what I was looking for :D
Comment #4
sunAttached patch additionally removes the bio node menu tab if editing of bio node in the user account form is enabled.
Comment #5
smk-ka CreditAttribution: smk-ka commentedBeware 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.
Comment #6
lelizondo CreditAttribution: lelizondo commentedI 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
Comment #7
lelizondo CreditAttribution: lelizondo commentedMake sure you don't enable this option before every user on the site has created a bio node because you'll get:
when trying to view the user's profile page
Comment #8
fehin CreditAttribution: fehin commentedThe 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.
Comment #9
lelizondo CreditAttribution: lelizondo commentedI 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