Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Slug validation rule fails in default.yaml - bug?

form

Started by Nick 9 years ago · 4 replies · 859 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 Paul Hodges, 4 weeks ago
19 485 5 days ago
Support · by Lauw, 7 days ago
2 101 7 days ago
Support · by Anna, 3 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 484 4 weeks ago