I tried this module with views but unfortunately not successfully, because filters don't work. Is dependent compatible with views?
Thanks

Comments

Tamar Badichi-Levy’s picture

I have never tried to use view with this module but I don't see why there should be any problem with filters. I will test it and will comment soon.

spasmody’s picture

apparently views is not able to display the conditional field after the first one...

Tamar Badichi-Levy’s picture

I hope you mean that the module is not able to HIDE the conditional field if it is dependent on a field that itself depends on another field. I tested it with the views module and the functionality of hiding a field automatically if its parent field is being hidden was not set right. I have fixed this and uploaded a new release. Now the views module will not see the hidden fields because they are being 'unset' in hook_nodeapi.

Please let me know if I understood your point. :)

spasmody’s picture

Thanks for updating Levyofi but there is a problem with function.array-merge :

warning: array_merge() [function.array-merge]: Argument #2 is not an array in /Users/Arnaud/Web/maths-physique/sites/all/modules/dependent/dependent.module on line 29.

Here is my problem.
Your module is perfect to create a node with conditional fields.
But I need to create a view filtering nodes according to both main fields and child fields (I use exposed filters).
Unfortunately, it doesn't work yet
What do you think?

Tamar Badichi-Levy’s picture

Thank you about the warning I guess I could have thought about cases where $form['#validate'] will be undefined. I'll update and upload a new release today.
About the views, please be more specific. Do you mean that the filter still filters by child fields that should be hidden. The way I see it, a hidden field should not be taken into account when filtering. therefore it might be necessary to 'unset' these fields during node load and not only during node view. Can you give me a url of your test site?

spasmody’s picture

here is the url of a test view :
http://numero1.maths-physique.fr/cours

This is an extra teaching site (in dev version)
You can log (as administrator) using login guest and password guest.
You can see two exposed fields. The second one is dependent on the first one.
Now I realize I need a kinf of hierarchical select for dependent fields.
hummm.... I really don't know what to do to filter according to two levels.
I tried before using taxonomy but not successfully.
It's hard Drupal!

Tamar Badichi-Levy’s picture

Yes I guess the dependency levels make it more complex to do filtering with views, because every select on a parent level should expose different filtering options in the child level. Am I right?

spasmody’s picture

Exactly. Apparently it is not possible using taxonomy and hierarchical select: the node doesn't display the parent term (only the deepest one).
Yet this request seems to be basic...

Tamar Badichi-Levy’s picture

Well, this feature should be added to the views module. I believe it should involve some javascript manipulation depends on filtering choices.