conflict with panels

meeotch - April 6, 2008 - 02:11
Project:Dependent Fields
Version:5.x-1.3-beta
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

So here's the test case for the panels issue I mentioned earlier. Basically, the issue is that dependent fields don't seem to show up when displayed in a panel.

1) create a content type with a checkbox & a text field, make the text field dependent on the checkbox.
1a) put both the checkbox & the text field into a CCK Group.
2) create a node of this new type, click on the checkbox & type some text into the field. Submit the node.
3) create a "Panel Page"
- set the URL to something like "node/%/panel"
- on the "Context" tab, add a "Node ID" argument
- on the "Content" tab, add a "CCK Group" pane, and set it to the group from #1a above.
4) go to mysite.com/node//panel (where is the id of the node created in #2 above)

You'll notice that the checkbox value is visible, but the text field is not. If you edit the content type so that the text field is no longer dependent, then refresh the panel page, you can now see both the checkbox & text field values.

I think this has to do with the code that unsets dependent fields within views. I commented out line 133 of dependent.module:

            //unset($node->content[$field->child_field_name]);

and the behavior was (almost) correct... The dependent text field shows in the panel. (However, if the dependent field has a value, but it's hidden [parent checkbox is False], it still shows up in the panel... which is probably wrong.) I suppose that the child should be set/unset depending on the value of the parent - but I don't know if that conflicts with the Views behavior, so I won't attempt a patch.

 
 

Drupal is a registered trademark of Dries Buytaert.