Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Slug validation rule fails in default.yaml - bug?

form

Started by Nick 9 years ago · 4 replies · 1029 views
9 years ago
YAML
                    folder:
                      type: text
                      label: PLUGIN_ADMIN.FOLDER_NAME
                      validate:
#                        rule: slug
                        pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
                        min: 1
                        max: 200

rule: slug doesn't appear to be being parsed. If I copy pattern etc from the top of the file, it works as expected. If I inherit default.yaml in theme blueprints no validation will take place.

Is this a bug?

Cheers, Nick

9 years ago

But the rule doesn't work...

9 years ago

Hmm.. try this to reference it in the field:

YAML
            validate:
                required: true
                rule: slug

If this works, we have a typo in the docs.

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 24 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago