Right now profiles enable the create of individual checkboxes and list selection, but there's no way to create a group of RELATED checkboxes. Here's an example of a non-Drupal page that I'd like to emulate:
http://www.billingstennis.org/members/findagame/index.cfm
When tennis players enter their "play type," they have three options that they can check: singles, doubles, and mixed. They can choose more than one if they wish, but the interface makes it clear that the three options are related.
Drupal's forms API includes a form_checkboxes function (soon to be replaced, of course, by the new forms API). It would be great if similar functionality could be added to the profiles module.
Comments
Comment #1
sheldon rampton commentedI did some hacking on the profile module and came up with a patch that adds checkbox groups. I think this patch also fixes the problem with date displays that has been mentioned recently in a separate bug report.
Comment #2
sheldon rampton commentedOops. I seem to have screwed up the title of this feature request. Hopefully this changes it back.
Comment #3
kbahey commentedChanging title to old one to avoid confusion.
Comment #4
Rezzo commentedThank you, very useful. I need to implement this in a large community website, is this going to be officially implemented? Or will I probably lost every data stored via checkbox groups?
Anyway, using v4.6.3 I had these part rejected from patching process:
But it works correctly.
Comment #5
Rezzo commentedIs there a way to keep checkboxes selected when a user goes to modify his profile? They're all unselected even if they were stored before.
Thanks
Comment #6
Rezzo commentedMy fault, sorry: I changed name to all my fields and got lost the relation between field value and checkbox selection when modifying a user profile. Checkboxes remain selected.
Comment #7
jasonz-1 commentedAny chance this can be ported to 4.7.2? I tried modifying the patch myself but couldn't get it to work. I'll try again and post my progress.
Comment #8
beginner commentedAll features go into cvs. If you want this, please provide a patch against cvs.
Comment #9
jasonz-1 commentedI managed to modify the patch to work with 4.7.2.
Comment #10
beginner commentedEverybody: if you are interested, there is a patch for 4.7.2 in #9.
Unfortunately, as per Drupal's policies, no new feature will be committed in a stable branch.
Now, if you want to have this function in future releases as well (4.8 onwards), a patch against cvs must be provided.
Comment #11
Guy Shepperd commentedthis is awesome, Finally found something via a search of the Site that I need!
Now only one question?
this is the patch for 4.7.2 is this to replace the Profile module? (patch on #9)
and is that how I implement it?
Thanks
Guy Shepperd
www.speedsurfing.com
Comment #12
beginner commented@guy: you need to patch the 7.2 module with the patch attached in #9.
About applying patches, see:
http://drupal.org/node/22568
But if you guys want this for the next version, you need to code a patch against cvs, and have it reviewed, otherwise, you are still left without this feature next time you upgrade.
Comment #13
moshe weitzman commentedsee http://drupal.org/node/33044
Comment #14
beginner commentedHow can an issue be a duplicate of itself?
Comment #15
moshe weitzman commentedoops. i meant http://drupal.org/node/19356
Comment #16
moshe weitzman commentedunduping this since it has a patch that actually works.
Comment #17
zmove commentedI'm upping the problem because it's not officially resolved, and I just tested Drupal 6-dev and it's not changed...
Comment #18
beginner commentedThis issue is assigned to jasonz, but he provided a patch for 4.7 (#9) instead of HEAD, so his patch was never considered for inclusion.
Now, it's too late for D6.
Comment #19
zenoyu commentedI have customised the module to allow using checkboxes group by the article in Drupal 4
Comment #20
beginner commenteddon't downgrade the version. You are making the same mistake as Jason (see comment just above yours).
Comment #21
beginner commentedtitle!
Comment #22
nvl.sateesh commentedhey! i tried applying the patch to drupal 5.x and it seems to work well... of course, i did not follow the line numbers... :-)
Comment #23
eddanx commentedI successfully applied this patch to drupal 5.7. I just copied & pasted from the patch manually into profile.module. I couldn't get it to display when viewing people's profile, though, so I headed to profile_view_field(), and made it work with replacing
with
Bit of a hack I guess, but it worked.
Comment #24
moshe weitzman commentedAnyone available to resubmit this for HEAD?
Comment #25
Susurrus commentedHere's an updated version for HEAD. Seems to work fine for me.
Comment #26
marcoBauli commentedjust another try:
#19 above works on D5.x
Just a glitch: when clicking on profile values to see other users that wrote the same (es: Other members from 'country'), the page title does not show the content of the value, but only the custom text specified in the settings for that field (result: Other members from *blank, no country shown*).
Comment #27
marcoBauli commentedjust marked http://drupal.org/node/47744 and http://drupal.org/node/193075 as a duplicates of this issue (33044).
a couple of other older patches respectively for 4.7 and 5.x can be found there if interested.
Comment #28
marcoBauli commentedfollowing up:
profile.module at #19 above falls into the warning below when posting a node:
warning: implode() [function.implode]: Bad arguments. in /accounts/lucamarino/www/jayculture.it/modules/profile/profile.module on line 591.
as an array was not declared.
Attaching the revised module below.
Comment #29
daniorama commentedTrying it on D6...
Comment #30
Anonymous (not verified) commentedThe last submitted patch failed testing.
Comment #31
jsaints commentedI created a patch for the latest head that adds "checkbox group" as a field type to the profile module. The patch includes a test for the checkbox group (I would like feedback on it).
It applies cleanly to latest head and passes all tests. Please review.
This is a straightforward patch that will be a useful feature for many others.
Comment #32
jsaints commentedupdated patch. Found a bug where $options was not initialized to array().
Comment #34
Equ commentedHow about checkboxes for D6 profile module?
Comment #35
mittalpatel commentedIt's showing options of other checkboxes.
For example if there are two checkboxes groups. 1 with options of Red, Blue and Green and another with options of Earth, Pluto, Saturn.
Then in either of the groups it will show all the options Red, Blue, Green, Earth, Pluto, Saturn.
Is there anything wrong I am doing? Or is it a problem of code it self???
Comment #36
daniel wentsch commentedSubscribing.
Has anybody been succsessful patching profile.module of D6 yet?
Comment #37
stevekerouac commentedSubscribing. Just updated from D5 to D6 and realised I had this running on 5.
Comment #38
oneoftwo commentedSince I really need this feature (as well as #124348: Multiple Select List addon) on my site, I rewrote/combined/updated my own 5.x module for the purpose, the one provided here by jsaints, and gonzalez_ea's from the other feature request thread (most of the credit is due for those guys, not me). Here is my first attempt at a combined patch. Any input and corrections, especially in the pages.inc and .test parts, is very welcome.
PS: this thread needs to stay at 7.x, since no new features such as this will go into the 6.x series...
Comment #40
oneoftwo commentedsorry, wrong version uploaded before... any input on remaining exceptions would be very much appreciated.
Comment #42
oneoftwo commentednew and improved... now it definitely works on my drupal 7 installation (including the pages.inc part); only the test module is still questionable, mainly since i can't get simpletest to behave.
Comment #44
lilou commentedshould be :
^ public static, t() and coding standard of array.
Comment #45
lilou commentedcross-post with testbot ;-)
Comment #46
oneoftwo commentedthanks very much! with this, today's HEAD and some very minor simpletest hacking, i could finally run the tests. so after some debugging, here's the new version, which should pass all the tests (because the tests now finally do the stuff they should do).
the one thing i'm most unsure about is the following code snippet from the test module, where the array keys might be incorrect (although it works this way as well...)
as always, help is very much appreciated!
Comment #47
oneoftwo commentedUpdate in the profile.test part: more comments, less code (by merging the rather similar test classes for checkbox groups and multiselect lists into one).
Comment #48
webchickShoot. :(
We finally got someone to code this up for a Drupal development version during a code thaw! With test coverage, even!! But unfortunately, this is the release where we got Field API in core, which means that if all goes well, Profile module will effectively be going away in favour of using Field UI to attach fields to users, including checkboxes and multiselect boxes. I can't really justify committing this patch when we need efforts to go around things like an upgrade path to field API from Profile module, rather than adding more features to Profile module.
The good news is that if you download and install CCK right now, you can add any fields you want to users, including checkboxes and multiselects. :)
But with regret, I have to mark this won't fix. :( Please keep up your great work in other Profile module patches though. It'd be great to get this cleaned up to make the migration easier.
Comment #49
oneoftwo commentedNo worries, as long as functionality exists, I'm happy :) .
In that spirit, I'll just leave my D6 port of the patch here for people to use until D7 is here.
Comment #50
ignition25 commentedUPDATE: works great! I also added a 'radios' type
Comment #51
mohamed_e commentedThanks for the great work! As I am not a programmer and depening on others, one question: When I have to implement this feature in a running site now, which way should I go? CCK 6.x does not provide this (yet) in such a way as far as I know. However, when I implement this patch now, it does not get supported in future, so it is not a great way to go... Any suggestions?
oneoftwo, what is the way you go?
Thanks a lot for any insights ans suggestions!
Comment #52
mohamed_e commentedDoes somebody know which module/patch does provide the 'Languages spoken:' like here on the drupal.org site? It also has also multiple select in which I am interested in. Thanks a lot in advance!
Comment #53
orb commentedRemoval in checkboxes inactive points.
It is necessary for use of fields of a profile in tokens.
ps. fix -> checkboxes_33044_multilist_124348_D6.patch
Comment #55
MattBrigade commentedThe good news is that if you download and install CCK right now, you can add any fields you want to users, including checkboxes and multiselects. :)
Is this referring to Drupal 6 or 7? I'm in 6 right now and can't see where I can add multiselects to users using CCK? Or does this require the "Content Profile" module?
Thanks!
Comment #56
HGabi-1 commentedGood afternoon,
please can anybody help me to write a views handler for the checkbox group and multi selection list? The checkboxes_33044_multilist_124348_D6.patch (#49) works very well, but after select one item of the view, there is no result. I need a views handler, which will give me the result after select one item.
Best thanks and regards.
Comment #57
rituraj.gupta commentedYou can use http://drupal.org/project/profile_checkboxes.
Comment #58
grendzy commentedPer webchick's comments in #48 (for Drupal 7), marking as "won't fix". This proposed change is also not suitable for Drupal 6 since new features are not added to stable releases (see http://drupal.org/node/10262 ).
Comment #59
alan d. commentedMmmm... Isn't fieldable Profiles a Drupal 8 feature now? As such, should we be lacking this primitive functionality from Drupal core for another 2 to 4 years?
Watching profile2 project (http://drupal.org/project/profile2) with interest to see if we can finally have a nice to use / extend profile module in Drupal. [Someone should close http://drupal.org/node/798648 if it gets in :)]
Comment #60
moshe weitzman commentedUsers are fieldable in D7. Or sites can create a new Profile entity and field that. So, we have two better solutions than profile for D7.
Comment #61
damien tournoud commentedThe profile module is obsolete. Won't fix.
Comment #62
adityadubay commented#47: checkboxes_33044_multilist_124348_47.patch queued for re-testing.
Comment #64
grendzy commentedPlease do not reopen this issue.
Comment #65
linuxeasy commentedHi All,
This is a bit customization on http://drupal.org/project/profile_checkboxes
which makes multiple-select-box on profile page Working.
Sorry as i dont know about creating a patch, i have posted a complete module with customization which can be directly enabled/disabled.
This module if used is a fully working and tested one!
Usage is same as you would use profile_checkboxes module. It give you a fourth option of creating a multi-select list-boxe when you create a new profile file which is usually yoursite.com/admin/user/profile/add/selection (see at bottom of this page after module installation).
Please find this module customized at http://drupal.org/files/issues/profile_checkboxes.zip
Thanks!
Linuxeasy!
Comment #66
grendzy commentedlinuxeasy - this issue is closed - perhaps you meant to post in the profile_checkboxes queue?
http://drupal.org/project/issues/profile_checkboxes?categories=All