Doesn't work with content profile, no errors, nothing.
conditional_fields.js is included normally
How it should be fixed or what function should be called to make it working?

Comments

kenorb’s picture

Status: Active » Closed (duplicate)

It can be related to this one: #357506: Compatibility with CCK 3x multigroup

kenorb’s picture

Status: Closed (duplicate) » Active

But probably not.
On node/add/type it's working, but when I'm going to form what was created via autoassignrole+content_profile it doesn't work.

kenorb’s picture

Here is the difference:
This one is working fine:

<fieldset class="group-basic-info"><legend>Basic Information</legend><div class="conditional-field controlling-field conditional-field-processed" id="conditional-field-title"><div id="edit-field-title-value-wrapper" class="form-item">
 <label for="edit-field-title-value">Title: <span title="This field is required." class="form-required">*</span></label>
 <select id="edit-field-title-value" class="form-select required" name="field_title[value]"><option selected="selected" value="">Please Select...</option><option value="Mr.">Mr.</option><option value="Mrs.">Mrs.</option><option value="Ms.">Ms.</option><option value="Miss">Miss</option></select>
</div>
</div><div class="conditional-field controlled-field" id="conditional-field-mother-first-name" style="display: none;"><div id="edit-field-mother-first-name-0-value-wrapper" class="form-item">
 <label for="edit-field-mother-first-name-0-value">Mother's First Name: </label>
 <input type="text" class="form-text text" value="" size="60" id="edit-field-mother-first-name-0-value" name="field_mother_first_name[0][value]"/>
</div>
</div><div class="conditional-field controlled-field" id="conditional-field-mothers-surname" style="display: none;"><div id="edit-field-mothers-surname-0-value-wrapper" class="form-item">
 <label for="edit-field-mothers-surname-0-value">Mother's Surname: </label>
 <input type="text" class="form-text text" value="" size="60" id="edit-field-mothers-surname-0-value" name="field_mothers_surname[0][value]"/>
</div>
...

This one not:

<fieldset class="group-basic-info"><legend>Basic Information</legend><div class="conditional-field controlling-field" id="conditional-field-title"><div id="edit-field-title-value-wrapper" class="form-item">
 <label for="edit-field-title-value">Title: <span title="This field is required." class="form-required">*</span></label>
 <select id="edit-field-title-value" class="form-select required" name="field_title[value]"><option selected="selected" value="">Please Select...</option><option value="Mr.">Mr.</option><option value="Mrs.">Mrs.</option><option value="Ms.">Ms.</option><option value="Miss">Miss</option></select>
</div>
</div><div class="conditional-field controlled-field" id="conditional-field-mother-first-name"><div id="edit-field-mother-first-name-0-value-wrapper" class="form-item">
 <label for="edit-field-mother-first-name-0-value">Mother's First Name: </label>
 <input type="text" class="form-text text" value="" size="60" id="edit-field-mother-first-name-0-value" name="field_mother_first_name[0][value]"/>
</div>
</div><div class="conditional-field controlled-field" id="conditional-field-mothers-surname"><div id="edit-field-mothers-surname-0-value-wrapper" class="form-item">
 <label for="edit-field-mothers-surname-0-value">Mother's Surname: </label>
 <input type="text" class="form-text text" value="" size="60" id="edit-field-mothers-surname-0-value" name="field_mothers_surname[0][value]"/>
</div>
...

There is no display and no 'conditional-field-processed' option.

kenorb’s picture

Title: doesn't work with content profile » doesn't work with autoassignrole and content profile
designerbrent’s picture

Status: Active » Postponed (maintainer needs more info)

I just run the latest dev release with autoassignrole and content_profile and it seems to work fine both on the creation form and the profile edit form.

kenorb’s picture

Title: doesn't work with autoassignrole and content profile » doesn't work with content_profile_registration.module on Registration form
Status: Postponed (maintainer needs more info) » Active

Tested with dev on fresh installation, still doesn't work.
Needed module: content_profile (and submodule content_profile_registration).

How to reproduce the problem:
1. Create new content type with select list (filled with some choices) and two text fields.
2. Set some field condition between them via conditional_fields
3. Make this content type as Content Profile.
4. Go to Content Profile tab, and select Use On Registration.
5. Now try to register new user, Go to: /user/register on Anonymous
Conditional Fields are not working.

julianob’s picture

StatusFileSize
new1.12 KB

I hade the same issue. I identified the problem as an issue the allowed values in CCK fields. For some reasons, allowed_values and allowed_vales_php were empty, even that the fields had the proper functions to generate them. I solved the issue with a small snippet in the conditional_fields_allowed_values function on conditional_fields.module (patch attached). Don't know if the solution is elegant nor its impact on scalability, but it worked for me.

kenorb’s picture

Thanks for a patch, but in my case conditional_fields_allowed_values() function is even not executed;/
So it not solved the problem.

kenorb’s picture

Probably this patch from: #357558: Conditional fields in colappsed fieldsets are not hidden on edit page load.
caused the problem
I've reverted changes from:

$('.node-form').find('.controlling-field:not(.conditional-field-processed)', context).addClass('conditional-field-processed').each(function () {

to:

  $('.controlling-field:not(.ConditionalFields-processed)', context).addClass('ConditionalFields-processed').each(function () {

And now it's working fine.

kenorb’s picture

Status: Active » Needs work
StatusFileSize
new720 bytes
kenorb’s picture

Status: Needs work » Needs review
kaay’s picture

Thanks, for some reason patch isn't working but changing a line of code as you have mentioned its working perfect.

kenorb’s picture

Status: Needs review » Reviewed & tested by the community
peterpoe’s picture

The simplest way is to modify line 80 of conditional_fields.js to this:

  $('.node-form, #user-register').find('.controlling-field:not(.conditional-field-processed)', context).addClass('conditional-field-processed').each(function () {

Note the new #user-register selector.
I added this patch to dev.

kenorb’s picture

Thanks.

peterpoe’s picture

Status: Reviewed & tested by the community » Fixed

Marking as fixed.
In a future release, we should use a dynamic variable set in form_alter as selector, so the script is always sure where to look for the fields.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ss54’s picture

I am having the same problem of conditional fields not working in anonymous mode. Is there any solution for this as yet

rot3r1’s picture

i installed ver 2.0beta and 2.0Dev but it's seem that problem not solved for anonymous users..

pierremarcel’s picture

There is another post with the same issue, they have a work around for it. I applied it to 6.x.2.0-beta2 and it's working.
http://drupal.org/node/959728