Hello,

I know the beta1 version works fine with content profile but the latest dev version does not work with content profile on user registration and creating users by admin...

Fixes are appreciated.

Thank you.

CommentFileSizeAuthor
#12 conditional_fields.patch4.02 KBjjwhitney

Comments

Jānis Bebrītis’s picture

subscribe,
this is very essential!

Jānis Bebrītis’s picture

I see, author wanted to implement better way of modifying fields using #after_build

function conditional_fields_node_editing_form(&$form, $form_state) {
	$form['#after_build'][] = 'conditional_fields_node_after_build';
}

I don't know why, whether it gets rewritten by some other module (I searched for after_build in all contrib modules i had on site, but didn't find any) or it just doesn't work for me for some particular reason.

I changed that function so that it modifies fields right away (like it was done in 6.x-1.1)

function conditional_fields_node_editing_form(&$form, $form_state) {
	//$form['#after_build'][] = 'conditional_fields_node_after_build';
	
	$form = conditional_fields_node_after_build($form, &$form_state) ;
}

.. and it works for me (at least I didn't notice any problems with it yet)

anyway - further investigation is needed on this

nicholas.alipaz’s picture

Just thought I would jump in and say this affects me too. I would really like to see this work.

nicholas.alipaz’s picture

Another note, testing out Jancis fix does work.

joostvdl’s picture

Status: Active » Needs review

I tested the solution in #2 in the 2.0-beta1 version and it works fine

jonhattan’s picture

I'd say the oposite: «content_profile_registration not compatible with latest 2.x-dev of conditional_fields».

Please review this one: #826126: Add in #after_build callbacks to $form.

JThan’s picture

#2 worked for me. The patch in the other issue mentioned in #6 did not help.

Jānis Bebrītis’s picture

Okay, collegue of mine ( artis.bajars ) discovered that my method (#2) breaks validation. He used patch mentioned (#6) and it works now.

murias’s picture

Patch mentioned up in #6 worked well for me.

jjwhitney’s picture

Conditional Fields will only work for fields in the first Content Profile type (when you're using more than one Content Profile type per role) on Registration pages. None of these patches will fix this issue.

In the "conditional_fields.module" file, find this line: $type_name = $form['type']['#value'];. The first Content Profile type is the form's "type". The correct fix would probably involve setting $type_names = array_keys($form["#content_profile_registration_use_types"]); (when that value exists) and use that in the function, instead of the single-valued $type_name.

Is there anyone who would like to make a patch? Or test one if I make it?

JThan’s picture

Yes. I need that patch. I am willing to test.

jjwhitney’s picture

StatusFileSize
new4.02 KB

Great! Just apply this patch to conditional_fields / 6.x-2.x-dev / 2010-Jul-11.

I've only tested this on my website, so I'm interested in finding out if it solves your problem, too.

The one thing I didn't bother to support is having different animation options (type and speed) for each content profile. The first content profile with conditional fields will determine which animation options are used.

JThan’s picture

Hi. Sorry just saw your answer. I will test today or tomorrow. I will report asap.

JThan’s picture

Hello.
Did not work for me. No difference at all.
JThan

jjwhitney’s picture

Sorry it didn't help. It really only covers the case where there are multiple content profiles on the registration page. If you're doing that, you'll probably need this patch in addition to one of the others. (Or might it be a cache problem?) The people who need this patch probably don't know how to find it, so I hope the Conditional Fields development team at least takes a look to see if they can use it. (Or create their own fix.)

JThan’s picture

But that is what I have: Multiple Content Profiles on one registration page. On a page just for the one content profile conditional fields does it work, but not on the one with multiple content profiles. It was working some time ago before some updates, but I couldnt manage to go back to that state.

abaddon’s picture

i wonder if this is not a duplicate of http://drupal.org/node/619290 , should be set as so if it is and continue there

jjwhitney’s picture

I tried your patch, abaddon. It works fine for me and looks cleaner than my solution. Thanks.

dafeder’s picture

Patch works for me!

murias’s picture

Patch working here also.
Maybe it could get committed?

deggertsen’s picture

Status: Needs review » Closed (duplicate)

This appears to be a duplicate of #619290: Make Conditional Fields compatible with Content Profile module. I'm marking it as a duplicate so nobody else gets confused. If there is indeed a difference then please reopen.