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've added multiple select functionality to the profile module. Hopefully, it will be useful for someone.
Comment | File | Size | Author |
---|---|---|---|
#37 | profile_checkboxes.zip | 8.84 KB | linuxeasy |
#24 | profile.views_.inc_.zip | 2.22 KB | stevekerouac |
#16 | profile.views_.inc__1.patch.txt | 896 bytes | anthrocreative |
#16 | views_handler_argument_string.inc_.patch.txt | 505 bytes | anthrocreative |
#15 | profile.views_.inc_.patch | 709 bytes | gonzalez_ea |
Comments
Comment #1
drummNo features, such as this, will go into Drupal 5.x.
Comment #2
WeRockYourWeb.com CreditAttribution: WeRockYourWeb.com commentedThank you!
Just what I was looking for :) Actually - almost. Best would be the option to have multiple checkboxes. I like the options webform gives me but can't integrate a webform with the user profiles/ registration page. I see that this tutorial explains how to develop a full-fledged user profile in 5.1. Unfortunately I'm still with 4.7 and have a couple modules that aren't 5.1 compatible yet.
Thanks for this!!
Alex
Comment #3
WeRockYourWeb.com CreditAttribution: WeRockYourWeb.com commentedUpdate - I just patched your patched profile module with the patch from #9 on this thread, and lo and behold - it works! Multiple select checkboxes for profile/ registration page in 4.7. Sweet!
:)
Comment #4
drupalfan2 CreditAttribution: drupalfan2 commentedWhen activating this patch I get the following error:
Please help me to solve this! Thanx.
Comment #5
drupalfan2 CreditAttribution: drupalfan2 commentedProblem solved. I forget to delete one line.
Comment #6
drummDrupalFan2: Please do not move feature requests to stable versions; they will not be added.
Comment #7
Junesun CreditAttribution: Junesun commentedI used this and it worked right out of the box! Thank you so much! I can't believe this wasn't a standard functionality. Just goes to show that Drupal 5.x should probably be named Drupal 1.5.x in terms of maturity... In my list, this goes right next to not being able to translate menus without hacking.
Anyway, now that I patched this, I'm running into a bit of a problem with i18n_profile: i18n_profile allows me to translate the value lists used by the single select, but not the ones used by the multi-select (the rest still works fine). This is probably an easy fix, but I'm not familiar with Drupalese. If somebody can provide this fix quickly, I'm ready to give a small compensation.
Comment #8
vj0914 CreditAttribution: vj0914 commentedWhich file should I open to use the patch? I am a newbie. Thanks
Comment #9
vj0914 CreditAttribution: vj0914 commentedI found it,
Comment #10
moshe weitzman CreditAttribution: moshe weitzman commentedhttp://drupal.org/node/124348
Comment #11
quanders CreditAttribution: quanders commentedDoes this work with a 6.x version too? Thanks.
Comment #12
gonzalez_ea CreditAttribution: gonzalez_ea commentedFor what it's worth, I've messed around with bubbasan's patch and made a 6.6 version patch. Actually there are three, because the code has been split into 3 files. I've only been able to test it on localhost, but it works fine.
Comment #13
geraldito CreditAttribution: geraldito commentedworks fine for me on D6.9. thanx for the patch
Comment #14
tirdadc CreditAttribution: tirdadc commentedTried out the patch in #12 on D6.8, seems to work fine. One remaining issue though: the multi-select profile fields cannot be selected as filters in a View. I figure it would require putting together views_handler_filter_profile_multiselect.inc in views/modules/profile to properly process this, but I currently don't have the time to consider developing this. Oh well, back to checkboxes for now.
Comment #15
gonzalez_ea CreditAttribution: gonzalez_ea commentedAha! Thank you tirdadc, I didn't know where to begin to look to make the multi-select field visible in views. For my purposes, the same handler as for freeform lists was sufficient. If you want to create a new handler, you have to save it in views/modules/profile, modify the handler name in line 209, and then add some code to the function profile_views_handlers() starting on line 236. The patch is for the file views/modules/profile.views.inc
Comment #16
anthrocreative CreditAttribution: anthrocreative commentedThanks for this patch, it was exactly what I needed! I took it a step further and enabled it for arguments and sorting as well. To make it work for arguments, I had to patch views/handlers/views_handler_argument_string.inc too, which is really an ugly hack.
I'd much prefer to create another handler based on views_handler_argument_string.inc, but I was unable to get Drupal to find the handler -- kept saying "Error: handler for profile_xyz does not exist!" So obviously there's something else to adding a new Views handler (I copied views_handler_argument_string.inc, changed the class name, and made the other code changes needed).
Ultimately, the multi-select values really should be a one-to-many relationship, with one db row for each value. But that's deeper that I'm able get into patching Views at the moment, particularly since I'm not sure how possible it is within the Views framework.
Certainly, any improvements on these patches are welcome.
Comment #17
gonzalez_ea CreditAttribution: gonzalez_ea commentedDid you add the necessary code in the function profile_views_handlers() starting on line 236? Before I realized I could just borrow the freeform list handler, I created my own and then added an if statement or a case, I don't remember, in this function. Not at first, of course :) I had to see the 'handler does not exist error' about a thousand times before I clued in.
Comment #18
maria_zk CreditAttribution: maria_zk commentedThis is what I get for the drupal 5 path when making a view to display the results for multiple select:
The options that i selected, plus some leading zeros. Example: option1, option2, 0, 0, 0, 0 if i had 6 available options.
Any ideas on how to fix this?
Comment #19
stevekerouac CreditAttribution: stevekerouac commentedThis is amazing, thank-you! All seems to be working fine with 6.12.
Gonzalez - I know nothing about PHP but I really need to get this patch working with the 'list selection' handler type, not a completely new handler, but not the 'freeform list' type you have. Would this be simple to do, and if so how?
Comment #20
klokie CreditAttribution: klokie commentedThese all work for me in 6.12 as well. Thanks so much!
Seems to me this should be a standard option in the profile module.
Comment #21
jlab CreditAttribution: jlab commentedI totaly agree I really need this functionality... But hate patching sites on my production servers.
Can this be integrated into Drupal 6.x core profile module?
Comment #22
Niko_K CreditAttribution: Niko_K commentedThis should be integrated into the Durpal 6.x (6.13??) core module
Comment #23
pdcarto CreditAttribution: pdcarto commentedI manually applied the patches in #12 and #16 on 6.12, so I may have made a mistake though I really do not think I did (I've triple-checked each edit). I'm getting wsod after a user submits a profile form with a multi-select field (whether or not an option has been selected). After a this, the profile form is permanently unavailable to that user - the tab doesn't appear (I have two profile tabs: "Personal Info" and "Organization Info"; the multi-select field is in the second; after submitting this form, the "Organization Info" tab is permanently gone). If you try to get to that tab by manually entering the url, you get an access denied.
Strangely, any user who has saved this profile tab gets a wsod upon logout (permanently), while user/1 gets a wsod upon logout after the patches have been applied, whether or not he has saved this profile tab.
I am using the profile_role module, and I wonder if there is some unhappiness in the intersection with these modifications to profile?
I've been struggling to get a look at the php errors - nothing is getting written to the log file I set up, but I may have not set that up correctly.
I'm curious if anyone has any thoughts as to where I should look to figure this out?
Comment #24
stevekerouac CreditAttribution: stevekerouac commentedI was trying to perform Views filtering on multi-select fields. The site allows registered users to tag if they work with certain aspects animation, like 'Flash' or 'Stop-motion' from a list of about 20, using the multi-select profile field. Visitors to the site can then filter the list of users to those who have specified a given tag if they are looking for a certain skill.
I contacted the gonzalez_ea and she kindly responded with the following:
She also attached a file profile.views.inc which is uploaded here.
I used the .inc file and it did indeed work. You can see the result here:
http://test.animationeast.com/membersview
Unfortunately, it didn't work quite as I had hoped. In layman's terms:
If a member (listed user with profile) has selected 'Animation 2D' and 'Games' as her tags (from the multi-select list profile field), she will only show up in filtering if the searching user searches for members with BOTH 'Animation 2D' AND 'Games', in fact the filter only returns results which match exactly, so on the page linked to above if you filter for 'Animation 3D' you will get the user 'adrian roper' as that is the only tag he selected. Other users who have 'Animation 3D' AND other tags, get missed out.
Again gonzalez_ea tried to help me:
Unfortunately it is way beyond me to solve this as I am not a programmer and I have no idea what a handler is. But I thought someone else may find this code useful, or even know how to fix my problem. All I really need is to change a "IF $X = $Y" to "IF $Y CONTAINS $X" somewhere within Views... I think. But I doubt I'll ever work out where or how.
Comment #25
Boycho Dobrev CreditAttribution: Boycho Dobrev commentedI have the same problem. The query from
... WHERE
profile_values_profile_fieldX.value in('VALUE1','VALUE2')
...
must to be
... WHERE
((UPPER(profile_values_profile_fieldX.value) LIKE UPPER('%VALUE1%')
OR
UPPER(profile_values_profile_fieldX.value) LIKE UPPER('%VALUE2%')))
...
but I do not know where I have to correct the query.
Comment #26
oneoftwo CreditAttribution: oneoftwo commentedSince I really need this feature (as well as #33044: Support for checkbox groups and multi-select lists as a profile field types) on my site, I rewrote/combined/updated my own 5.x module for the purpose, the one provided here by gonzalez_ea, and jsaints's from the other feature request thread (most of the credit is due for those guys, not me). My first attempt at a combined patch can be found in the other thread.
Comment #27
oneoftwo CreditAttribution: oneoftwo commented#33044: Support for checkbox groups and multi-select lists as a profile field types
I decided to really mark this a duplicate since the other thread is older and the problem is now "resolved" for HEAD (with won't fix, but still). I also attached a working D6 patch over there.
Comment #28
monto CreditAttribution: monto commentedHi,
I'm using the module "User Import" to import multiple users and get the following error:
After, I have used the module "Node import" and after finishing all the steps does not matter. Furthermore, in step 4 of 8 say: "Unsupported" field.
Can you help me?
Comment #29
phelix CreditAttribution: phelix commentedI have drupal 6.14 and I tried to apply the patch listed to download on this page and it only patches like 3 of the 13 lines. and it completely destroys my drupal install. I get the white page of death on everything. Does this patch not work with this version? Am I doing something wrong? I go into the folder and run patch < patch_40.patch and then everything breaks. Am I doing something wrong?
Comment #30
sakiland CreditAttribution: sakiland commentedIt works on drupal 6.14. Try to do it manual. There is no much code. I use
profile.admin_.inc_.patch,
profile.module.patch,
profile.pages_.inc_.patch
#12
and
profile.views_.inc_.patch
#15
Comment #31
grendzy CreditAttribution: grendzy commentedNo new features can be added to stable releases. Marking "won't fix" in line with #33044: Support for checkbox groups and multi-select lists as a profile field types.
Comment #32
phelix CreditAttribution: phelix commentedI have this and I am able to view it in the search now. But why is the search field not a multi select? Its just a plain text box. This defeats the purpose doesnt it? Shouldn't this also be a select box? Did I do something wrong?
Comment #33
sol1313 CreditAttribution: sol1313 commentedThanks gonzalez_ea for the patch! Worked like a charm!
Comment #34
rituraj.gupta CreditAttribution: rituraj.gupta commentedThis module is perfect.
http://drupal.org/project/profile_checkboxes
Comment #35
designcontext CreditAttribution: designcontext commentedIs there a solution for the problem written in #24? I have the same and I am very interesseted in a solution but not able to write a handler...
Comment #36
danielbeeke2 CreditAttribution: danielbeeke2 commentedHa
finaly I fixed it.
I have the solution for #24
I am not really a coder but I managed to fix it.
It involves a hack in view_handler_filter_in_operator.inc
first in the function 'operators' add this
than add this
under the function op_simple
next thing to do is going to your view and in the filter options selecting like as the statement.
Comment #37
linuxeasy CreditAttribution: 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).
Thanks!
Linuxeasy!
Comment #38
rituraj.gupta CreditAttribution: rituraj.gupta commentedIs there any module for Drupal 7 like http://drupal.org/project/profile_checkboxes. I want to integrate with profile module (Not using profile2)