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.
I have created CCK fields for the Bio module. I want these fields to show up on the registration form. I am able to do so on the User Biographies configuration page [admin/user/bio]. I check all the fields that I want on the registration form. I am using field groups for groupings such as mailing address and interests.
They all appear on the form registration form but they are in the wrong order. I am wondering if the grouping has something to do with it because groupings do not show up on the registration form at all.
Comment | File | Size | Author |
---|---|---|---|
#7 | issue_234404.patch | 2.55 KB | jscheel |
#4 | issue_234404.patch | 2.53 KB | jscheel |
Comments
Comment #1
capellicFor anybody else having this problem, I got around Bio's issue by implementing a module to utilize hook_form_alter. If the idea of creating a module scares you, go to tutorial and you'll get a good idea of what it takes:
http://www.lullabot.com/articles/modifying-forms-5-and-6
Creating a module only requires two files - a .info and a .module file. Both files must be in the same directory which should be in your sites modules folder.
gbc_hook_form_alter.info
gbc_hook_form_alter.module
Comment #2
jerdavisI'm just starting to dig into this, so I have absolutely no idea how difficult it would be - but it seems like one solution to this ordering issue would be to group (stick/shove) all of the fields for the associated content type being used by Bio into one field set, and weight that field set appropriately on the user registration page, respecting any subsets and weighting for the bio content type within that fieldset. In theory, this sounds easier and cleaner than trying to jam all of the bio content type's fields in and around the registration page's existing fields.
If this is doable, or even makes sense - let me know, I'll see what I can do about writing a patch for it.
Comment #3
Roman S CreditAttribution: Roman S commentedThis is due to the fact that Bio does not correctly transfer the fields' weights when putting them on the registration form. The following line needs to be added to bio_form_alter:
This is similar to what the _content_widget_invoke function does in content.module.
Until the fix is in the build, I'm using the following code in mymodule_form_alter to avoid hacking the Bio module:
Comment #4
jscheel CreditAttribution: jscheel commentedI have attached a patch that will fix the two issues here:
Thanks for the idea everyone! Please test and let me know if this works for you. This patch was created from Bio 5.x-1.2.
Comment #5
capellicAwesome! Thanks for doing this!!!!
Comment #6
davedelong CreditAttribution: davedelong commentedthe patch worked great for me!
Comment #7
jscheel CreditAttribution: jscheel commentedFound a small problem with my earlier patch: empty fieldsets were not being unset. New patch is attached.
Comment #8
bomarmonk CreditAttribution: bomarmonk commentedWas this fixed already in the development version for 5.x? I see something about form alter and field groups in CVS for March 2008. I am wondering if it's better to patch the official release or go with the development version.