Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Slug validation rule fails in default.yaml - bug?

form

Started by Nick 9 years ago · 4 replies · 937 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 webmasterodp, 7 days ago
4 145 6 days ago
Support · by nwhitfield, 1 week ago
2 124 1 week ago
Support · by stell, 3 weeks ago
5 364 2 weeks ago
Support · by gravinator, 1 month ago
5 555 2 weeks ago
Support · by Gravver, 3 weeks ago
6 344 3 weeks ago