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

Fixed boolean test in conditional fields. #188

Closed
wants to merge 1 commit into from

Conversation

paulmassen
Copy link
Contributor

No description provided.

@paulmassen
Copy link
Contributor Author

I forgot to mention that this fix fixes a problem on conditional fields. The new updates makes the fields under conditional to be displayed no matter what the result of the evaluate condition is.

@rhukster
Copy link
Member

Can you provide me with your form definition where conditional field is failing ? I'm using it for the displaying the 2fa field in admin and it's working fine as is.

@paulmassen
Copy link
Contributor Author

Sure, I used it in my seo plugin, here is an example.
The fields are displayed/not displayed depending on the plugin configuration but it has stopped working after last update.
https://github.com/paulmassen/grav-plugin-seo/blob/master/blueprints/seo.yaml#L104

@rhukster
Copy link
Member

This actually breaks the simplified conditional format i created.. So i've fixed both in my 0105cae commit.

@rhukster rhukster closed this Sep 14, 2017
@rhukster
Copy link
Member

BTW to test:

    condition-1:
      type: conditional
      condition: config.plugins.admin.twofa_enabled

      fields:
       spacer-1:
          type: spacer
          text: Conditional Style 1

    condition-2:
        type: conditional
        condition: "config.plugins.admin.twofa_enabled ? 'true' : 'false'"

        fields:
         spacer-2:
            type: spacer
            text: Conditional Style 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants