Posted by ksun on October 22, 2009 at 1:14am
Jump to:
| Project: | Conditional Fields |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I set it so that orphaned fields would be displayed when triggered. (i.e.: The controlling field, while not editable, has an appropriate triggering default value, or were previously set by someone with permissions to edit the field in question.)
However, even when the controlling field (field_ticket_state) held the appropriate value to show the controlled field (field_proofs_okay), said controlled field was not displayed.
In function: conditional_fields_node_editing_form
<?php
if (!$show_triggered || !in_array($form_state['values'][$field['control_field_name']][0]['value'], $field['trigger_values'])) {
?>^--- $form_state['values'] is not set in my case.
So I worked around it by changing these lines to:
<?php
if (!$show_triggered || !in_array($form[$field['control_field_in_group']][$field['control_field_name']]['#value'][0]['value'], $field['trigger_values'])) { /*In Group, haven't tested this yet. */
?><?php
if (!$show_triggered || !in_array($form[$field['control_field_name']]['#value'][0]['value'], $field['trigger_values'])) {
/*Not in group, verified to work sometimes. Best way to do this? */
?>
Comments
#1
As usual, the bug you reported was hiding another bug :(
Fixed in dev: now orphaned fields in node editing form should display or hide properly.
Thanks
#2
this works in node editing form but not yet on node view....
could you please check ?
thanks
#3
#2 Node view is working for me. Make sure that "Reset untriggered fields to default values" is unchecked, or untriggered controlled fields will never appear unless they have a default value different than none.
#4
it seems to work fine now... thanks for the hint...