Posted by freelylw on November 2, 2010 at 9:01am
15 followers
| Project: | Conditional Fields |
| Version: | 6.x-2.0 |
| Component: | Compatibility w/ other modules |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
It works fine with authenticated user, but when anonymous user filling the node, the conditional field always showing even the trigger taxonomy has not been selected.
Comments
#1
Subscribing
#2
It seems that when you are not logged inn, the $form['#after_build'] is not executing properly.
If you want to workarround this, you can edit the file conditional_fields.module
and change the code:
function conditional_fields_node_editing_form(&$form, $form_state) {
$form['#after_build'][] = 'conditional_fields_node_after_build';
}
-------------------------------------------------
by
---------------------------------------------
function conditional_fields_node_editing_form(&$form, $form_state) {
//workarround by omitsis.com
global $user;
if(!$user->uid){
$form = conditional_fields_node_after_build($form, $form_state);
}
$form['#after_build'][] = 'conditional_fields_node_after_build';
}
#3
omitsis, you are a legend! That worked perfectly. I think it should be committed!
#4
Could be related: #373954: doesn't work with content_profile_registration.module on Registration form
#5
#2 works for me. won't it be commited?
#6
It works with regular core fields. What kind of fields are you using?
#7
i can verify this issue using:
- a controlling select / radios field
- a controlled fieldset
- content profile
- content profile registration
on the user registration form, the fieldset does not respect conditional settings.
in fact, content_profile_registration explicitly skips #after_build
it works fine on the content_profile edit form.
fago (content_profile maintainer) indicated a few times that this behavior is by design
#826126: Add in #after_build callbacks to $form
i can verify that the workaround in #2 fixes the issue.
#8
#9
I have the same issue after upgrading from 6.x-1.1 to 6.x-2.0, with content profile registration.
* controlling : select list
* controlled group with several text field
This patch solve the problem for me.
#10
This patch worked for my issue. There was one small code standards issue with the patch from #8 (needed space between if and the ()
Here is a fresh patch.
#11
For me also works fine 6.2, thanks!
#12
Thanks! omitsis ,
It works well.
#13
Works well for me, too.
#14
I have the same issue on the D7 x 3 x Dev.
I've tried numerous ways of applying the patch - but unfortunately my PHP skills are not up to it.
Any help much appreciated!
#15
Patch from http://drupal.org/node/959728#comment-4957982 fixed my issue. Please, commit it!
#16
Same problem ...can't be able to apply patch
Why in my conditional_filed.module there isn't this function?
"function conditional_fields_node_editing_form(&$form, $form_state)"
Both in 6.0.2 and 6.02-dev
Rename file in ".module" if needs
#17
The replacement function is #10 worked for me using D6, conditional fields 6.x-2.0, and content profile 6.x-1.0 w/ registration form for anonymous users.
#18
#19
Hi, I don't think my patch (http://drupal.org/node/959728#comment-4957982) is needed any longer. I had another problem and ended up trying the latest commits from the git repo that have not been released. I think they have fixed this issue with a different approach. My problem was related to my nodes being content profiles completed at registration. I believe this commit fixed my particular problem: http://drupal.org/commitlog/commit/4894/ab6a2be0356181a8d48003b9aa3d9881...
I'd close this, but my problem was more related to content_profile than just anonymous users. Perhaps others have different issue though. Since the patch cannot be applied to the current development branch, I am removing the RTBC designation.