Would it be possible to support states in hook_variable_info()?
I have some variables that depend on each other in the settings form.

Would be nice to be able to use this.

Comments

jose reyero’s picture

Variables can define the form element, which may have a '#states' property. What else do we need?

BarisW’s picture

It's been a few months since I've asked this question, so I don't know anymore what I needed this for. But I can image the following.

Suppose you have three variables:

mymodule_opened_on_monday
mymodule_opened_on_monday_start
mymodule_opened_on_monday_end

I only need the last two variables to be filled in when the first one is set. So it would be nice here if I could set the visibility already using #states in the info hook. Or maybe even just a simple 'parent' key that is used for this use-case.