Needs work
Project:
Conditional Fields
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2017 at 22:13 UTC
Updated:
13 Nov 2025 at 06:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
imclean commentedConditional fields doesn't seem to work with Profile module at all. To check, create a new profile type and add fields. There is no "Manage Dependencies" tab within the profile settings.
Comment #3
imclean commentedIt looks like you can get to Profile dependencies another way:
/admin/structure/conditional_fields/profile/profile_nameI'm still having trouble getting conditionals to work with Profile. I'm trying a simple show/hide conditional with a select list as the controlling field but it's having no effect on the form.
Comment #4
imclean commentedMy problem appears to be with Commerce and embedding the profile form within billing. An issue related to Inline Entity Form may resolve this issue as well: #2856720: Support for Inline Entity Form
Comment #5
7thkey commentedI'm having the same issue as #3, conditional fields module doesn't work with profile.
Comment #6
hannessconfirming #3
/admin/structure/conditional_fields/profile/profile_nameworks fineComment #7
nanabrownee commentedAny solution for this?
Comment #8
Andrew.Dmytriv commentedThis patch works for the profile on the registration page and for commerce profile customer billing-information.
Comment #9
socialnicheguru commentedComment #10
kris77 commentedThis patch cannot be applied to the last dev version
Comment #11
Andrew.Dmytriv commentedI added the new patch for the latest dev version
Comment #12
Andrew.Dmytriv commentedUpdated patch for 8.x-1.x-dev
Comment #13
dwkitchen commentedWhat's the reason we need to make reference to Commerce Billing Profile?
Tested and working with custom profiles on user registration form.
Comment #14
dwkitchen commentedWell, I said it works...
It correctly controls the fields to show on the registration form; but it breaks the submission of the form, preventing user registration.
Comment #15
sevenfish commentedMy profile's id is "license_information_profiles". Because I have two underscore(_), the #12 patch is not working. WHen I change one line in “conditional_fields.module”. It is working now.
Old:
New:
Comment #16
dwkitchen commentedComment #17
sevenfish commentedAfter I submit to “Create ew account” in Register Form, it always shows error. I check log.
Error: Call to a member function extractFormValues() on null in Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity() (line 338 of xxxxxxxxx\web\core\lib\Drupal\Core\Entity\ContentEntityForm.php)Google and find this post. It writes:
I check $form_state. After I use $form_state->setStorage($array), the "entity_form_initialized" in "storage" property is gone. So I edit it.
Old :
New :
Pass it.
Last issue. After I hide "required" field. It is still required.
Comment #18
j-vee commentedRe-created the patch for 4.x with additional fixes.
The code assumes right now that there's the word "profile" in the profile name. This could probably be streamlined if there's some code that first fetches all machine names of profiles and compares against them in conditional_fields_element_after_build function. But for our purposes, this works great.
Comment #19
j-vee commentedSorry, here's the latest one that works. Added the fix by sevenfish above.
Comment #20
daften commentedI'm testing out this patch, and the latest version doesn't work, and I don't see how it can work. The references from the user object to the profiles is _profiles. Where the regex with ^entity comes from, I have no idea, but maybe you can clarify how you got to that point @j-vee? :)
Using the patch as-is doesn't work for me, but replacing it by checking for _profiles$ doesn't work either and produces this error:
Comment #21
zegmant commentedIt still does not work on profiles.
Module 4.0.0-alpha2
Drupal 9.5.3
No patches of this page cannot be applied because of .module file changes
Comment #22
chucksimply commentedComment #23
nitrocad commentedUse ECA and ECA forms module instead of Conditional Fields.
Comment #24
freelylw commentedany progress for this issue, conditional fields doesn't work on profile module in Drupal10.x, I am getting the same problem