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.
Conditional field works perfectly when you use nodes.
But when the node is of type user profile that is created with the Content Profile module, the registration does not validate fields.
Comment | File | Size | Author |
---|---|---|---|
#54 | conditional_fields-work_with_content_profile-619290-54.patch | 562 bytes | lucascaro |
#41 | content-profile-compatibility-619290-41.patch | 4.93 KB | GaëlG |
#32 | conditional_fields_6.patch | 4.98 KB | abaddon |
#18 | conditional_fields.patch | 5.06 KB | jjwhitney |
#17 | conditional_fields.patch | 5.66 KB | jjwhitney |
Comments
Comment #1
peterpoe CreditAttribution: peterpoe commentedPlease hold on while #648934: Plugin system for compatibility with non-core CCK modules is developed.
Comment #2
Bilmar CreditAttribution: Bilmar commentedsubscribing
Comment #3
roball CreditAttribution: roball commentedFor me conditional fields on user profile nodes do work with 6.x-2.0-beta1, but only on the node/[NID]/edit pages, not when adding a new user with the user profile fields embedded into the user/user/create page.
Is there any way to get it working also on the user/user/create pages? Thanks!
Comment #4
roball CreditAttribution: roball commentedConditional fields still do not work on user/user/create pages with 6.x-2.0-beta2. Any chance to get this working until the final 2.0 release?
Thanks.
Comment #5
nod_That patch makes it work on user/registration and user/create, but it doesn't check that conditional fields is actually required.
Comment #6
roball CreditAttribution: roball commentedYeah, great, can confirm that after applying this patch Conditional fields work on user/user/create :-) Thank you!
Also I have no problems with required conditional fields.
I think the patch should get committed.
Comment #7
nod_there was still a little issue, got sorted out by explicitly casting to (array). It should be good now.
Comment #8
roball CreditAttribution: roball commentedI have reverted your original patch from #5 and applied the updated one from #7 and did some tests with more than one required conditional fields. The current patch worked as well as the original one, requiring the first required conditional field, but ignoring the second one on node save. On the first node edit, the second required conditional field was in fact required so you had to select something while editing, but didn't need to do so on creating the node (user).
Thanks anyway for your efforts!
Comment #9
Poieo CreditAttribution: Poieo commentedSubscribing...
Comment #10
stephesk8s CreditAttribution: stephesk8s commentedThe patch in #7 worked great for me. Thanks!
Comment #11
abaddon CreditAttribution: abaddon commentedthe patch in #7 works if you only have 1 content profile on the registration page or if the one that has conditional fields is the first one (as far as i can tell)
i had 2 content profile types and the second one had the conditional fields, problem is that the after build function checks only on the first one.. this is fixed in my patch
i also made a small fix to the form_alter hook to use the same function the module already used on nodes (same functionality though, at least right now.. that function just sets the after build hook)
please review this with only 1 content type and let me know how it works then.. also, i dont have any required fields that are conditional, so i didnt test that
Comment #12
jjwhitney CreditAttribution: jjwhitney commentedThumbs up from me! I've also confirmed that it works for required fields that are conditional.
Comment #13
loze CreditAttribution: loze commentedI can confirm that #11 works with required fields, and one or two content profile types.
Comment #14
roball CreditAttribution: roball commentedThen the status could be changed to RTBTC?
Comment #15
abaddon CreditAttribution: abaddon commentedComment #16
jjwhitney CreditAttribution: jjwhitney commentedWhoops... I thought this was fixed, but there's still a problem (though it's certainly a step in the right direction): If two or more content profiles have conditional fields, only the first set will work, because conditional_fields_add_js() only works the first time it's called (line 810 after applying abaddon's patch).
Comment #17
jjwhitney CreditAttribution: jjwhitney commentedI've generated a new patch that should fix this final problem. Please give some feedback!
Comment #18
jjwhitney CreditAttribution: jjwhitney commentedOoops... I made a small typo and I accidentally put one of my other fixes into that last patch. Try this one instead.
Comment #19
filiptc CreditAttribution: filiptc commentedNice job! #18 works like a charm! =)
Comment #20
deggertsen CreditAttribution: deggertsen commentedNot sure why but patch #18 did not work for me but it didn't. I also tried most of the other patches too with no success. I'm only testing on the registration page so I'm not sure if other pages are working or not.
Comment #21
nicholas.alipaz CreditAttribution: nicholas.alipaz commentedsubscribing, was on the duplicate bug and want to follow this thread too.
Comment #22
jjwhitney CreditAttribution: jjwhitney commenteddeggertsen... Could you tell us a bit more about your situation? Is it possible to replicate your problem on a fresh Drupal 6 install? If so, I'll try to get it figured out for you.
Comment #23
deggertsen CreditAttribution: deggertsen commentedI'll try to just reinstall when I get a chance and see if it will work then and let you know. Hopefully today...
Comment #24
deggertsen CreditAttribution: deggertsen commentedJust uninstalled and reinstalled with patch #18 and everything works wonderfully! Sorry to cause any doubt...
Thanks!
Comment #25
aaki CreditAttribution: aaki commentedIt's working like a charm for me too. Using drupal 6.20, content profile 1.0 and the patched (#18) version of conditional fields 2.0-beta2. I'm wondering that it is not in dev already?
Anyway, jjwhitney, thanks a lot!
Comment #26
aaki CreditAttribution: aaki commentedOh, one thing. If you're using drupal_get_form('user_register') in your template or in a preprocess function you have to make sure the additional JS is loaded. Then conditional field is working on those forms too.
Comment #27
drupalnesia CreditAttribution: drupalnesia commentedAfter apply #24 then Patch #18 works fine! RTBC to 6.x-beta3?
Comment #28
MXTPatch in #18 works very well for me, in user registration page.
Can this be committed ?
Thank you very much
Comment #29
ss54 CreditAttribution: ss54 commentedI would be so grateful if you would teach me how to apply this patch; where to insert. Thanks
Comment #30
abaddon CreditAttribution: abaddon commentedhttp://www.google.com/search?q=drupal+apply+patch
theres some page on drupal.org but i cant find it, i found something GIT specific and its not what you want
continue in the support forum, this isnt the proper place to ask
Comment #31
ss54 CreditAttribution: ss54 commentedThanks abaddon, I found how to apply a patch on the the conditional_fields module, but the issue now is that the patch is not being implemented successfuly. I am getting an error when I am applying the patch
Comment #32
abaddon CreditAttribution: abaddon commentedthe patch in #18 applies cleanly to conditional_fields-6.x-2.0-beta2 but with -p1 instead of -p0, heres an edited patch that should work with the default -p0 (does windows have -p? sorry i only have linux)
and i didnt test the patch, just edited for -p0
make sure you apply it to the proper version of the module, and not an older one
Comment #33
onejam CreditAttribution: onejam commentedNice work. I was using content profile and needed conditional fields to work on registration form (frontend). It was okay in edit form but your patch help to make it work on on both so thank you.
using this patch with:
conditional fields 6.x-2.0-beta2
content profile 6.x-1.0
Comment #34
max0u CreditAttribution: max0u commentedHello,
I have applied the patch below (32), that is what I get :
conditional_fields_6_0.patch:21: trailing whitespace.
Checking patch conditional_fields.module...
Applied patch conditional_fields.module cleanly.
warning: 1 line adds whitespace errors.
But fields are staying disabled when adding a new user. Even if when I activate the controller field.
Any idea ?
Rectif : Not working when controlling a "Group", but it is working when controlling directly a field.
Comment #35
capellicI applied the patch in #32 cleanly and works!!
Comment #36
int_ua CreditAttribution: int_ua commentedNo problems detected after patching from #32 :)
Comment #37
roball CreditAttribution: roball commentedSo could this please get committed?
Comment #38
andiart CreditAttribution: andiart commentedfor me it also doesn't work. i have two content profiles for 2 different registration procedures. for choosing the right profile in login I use autoassign role
Comment #39
roball CreditAttribution: roball commentedUnfortunately, the final 6.x-2.0 has been released now without including this patch :-( After trying it out I realised that it does NOT work with content profile fields, and this thread's patches no longer can be applied either. So I had to revert back to 2.0-beta2 with the patch #18, which is working fine.
@abaddon: Patch #18 is alright - since Drupal's revision control is Git based patches must be in -p1 format (and no longer in -p0).
Comment #40
roball CreditAttribution: roball commentedSince patch #18 cannot be applied to 6.x-2.0, can anybody please port it to work again with the latest official release?
Comment #41
GaëlGHere's the new patch.
Comment #42
roball CreditAttribution: roball commentedExcellent, patch #41 works perfectly with 2.0. Thank you. Hoping that it finds the way to the official code one day.
Comment #43
roball CreditAttribution: roball commentedComment #44
manuel.adanAs 1.1 is not supported any more, any website may fail after security update from 1.1 to 2.0.
Patch #41 works fine, thank you!
Comment #45
roball CreditAttribution: roball commentedNot sure about which security update you are speaking.
Hope to see this patch finally applied in 2.1.
Comment #46
Encarte CreditAttribution: Encarte commentedSubscribing
Comment #47
lucascaro CreditAttribution: lucascaro commentedworks like a charm for 6.x-2.0!
Comment #48
roball CreditAttribution: roball commentedYes, but still needs to be committed!
Comment #49
roball CreditAttribution: roball commentedAny chance to get this patch committed? It is urgently needed.
Comment #50
Anonymous (not verified) CreditAttribution: Anonymous commentedIs there a reason this patch hasn't been committed yet??
Comment #51
filiptc CreditAttribution: filiptc commentedLatest dev version (2012-02-03) introduces modifications that make patching useless (even when applying manually).
Comment #52
lucascaro CreditAttribution: lucascaro commentedsince #648934 and this issue have 2.5 years and there's not much advance in the other one, maybe it's worth to create a new patch and commit it for now?
I'll get into that since I need the functionality and I'll post it back here.
Cheers.
Comment #53
lucascaro CreditAttribution: lucascaro commentedWell, it seems that making it work with content profile was easier than I thought. here's a patch to get this rolling, it works for my use case but it might need more work for other people.
Anyone care to review?
Comment #54
lucascaro CreditAttribution: lucascaro commentedand yes, the patch.
Comment #55
elly CreditAttribution: elly commentedNM, patched the wrong version
Comment #56
lucascaro CreditAttribution: lucascaro commentedpinging the maintainers for any feedback about this patch?
Comment #57
roball CreditAttribution: roball commentedChanging the Component to "Compatibility w/ other modules". I am also waiting for maintainer feedback, now for almost 2 years...
Comment #58
peterpoe CreditAttribution: peterpoe commentedThe patch does not fix the issue. Content Profile does not add #after_build callbacks when taking over the node form, so I fear there is very little we can do except trying to get this issue #826126: Add in #after_build callbacks to $form reopened and fixed.
Comment #59
peterpoe CreditAttribution: peterpoe commentedOk, never mind the last comment. The patch was good and fixes the problem, so I committed it (with an additional check for the existence of the #content_profile_registration_use_types property). Thanks to everyone involved and sorry for the long wait!
Comment #60
lucascaro CreditAttribution: lucascaro commentedawesome! thanks :)
Comment #62
roball CreditAttribution: roball commentedCan confirm that the commit to 6.x-2.x in fact fixed the problem. The current dev (6.x-2.0+12-dev) is working fine in supporting the Content Profile module. Thanks!
Comment #63
ashvin_drupal CreditAttribution: ashvin_drupal commentedHi,
above patch working fine on contact profile module with conditional but, one issue generate as per below :
I have a user registration form which contain profile fields and some conditional fields with dependency on group selection as per show some fields and some hide as well . When form submit than hidden fields (which is currently hide) validate, also. Display error message to provide hide fields values as well.
So, Please can anybody help me to sort-out this issue
https://drupal.org/node/2028343
Comment #64
roball CreditAttribution: roball commentedThis issue is fixed, so please don't re-open it just for asking support. You have already created an own issue for that.