Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conditional: check if key is empty #2489

Open
markus2330 opened this Issue Mar 13, 2019 · 2 comments

Comments

Projects
None yet
4 participants
@markus2330
Copy link
Contributor

markus2330 commented Mar 13, 2019

I need to express that "if isempty(a) then istrue(b)".

Is this possible with conditionals?

How to say "isempty"? ("isempty" refers to if it contains a string with length 0)

Does "istrue" also work if the keys are yes/no? (Together with the boolean plugin. Maybe we need another ordering here?)

@kodebach

This comment has been minimized.

Copy link
Contributor

kodebach commented Mar 13, 2019

I need to express that "if isempty(a) then istrue(b)".

If you mean that if a is empty b must be true, I guess (haven't tried it) setting this on key a should work
( ./ == '' ) ? ( ./relative/path/to/b == '1' ), as long as boolean is mounted first.

But I think the whole conditionals plugin is quite broken, and if nothing else, we should at least remove the maintained status.


Also infos/ordering is not really a good solution. You need to know about all other plugins to specify it correctly. If you write a new plugin, you also have to update any existing plugin, if your plugin has to be executed first.

@markus2330

This comment has been minimized.

Copy link
Contributor Author

markus2330 commented Mar 13, 2019

should work

Yes, it may work but I never tried it, thus I ask.

Thank you for the code!

But I think the whole conditionals plugin is quite broken, and if nothing else, we should at least remove the maintained status.

Yes, I agree.

Also infos/ordering is not really a good solution.

It is only for one situation: If two plugins of the same type (like it is the case here: boolean and conditionals are both validation plugins) have requirements that one must be before the other. Otherwise a different placement should be chosen.

@markus2330 markus2330 removed the urgent label Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.