elleracompany / craft-cookie-consent

GDPR-Compliant cookie consent banner for Craft CMS
Other
6 stars 5 forks source link

No error output for cookie groups #96

Open mikewink opened 1 year ago

mikewink commented 1 year ago

There is an issue with saving a cookie group. None of the required fields is marked. When I try to save the form, it redirects me back to the README with an error message.

I can see that the there are validation rules in place for name and description, but no errors are displayed after attempting to save the group with empty form fields.

I guess adding a required: true on the two form fields would be a first step, but the underlying issue is the missing error messages, I think.

templates/_includes/group.twig

{{ forms.textField({
    id: "name",
    label: group.getAttributeLabel('name'),
    name: "name",
    disabled: disabled,
    required: true, <-- new attribute!
    value: group.name,
    errors: group.getErrors("name"),
}) }}

{{ forms.textAreaField({
    id: "description",
    label: group.getAttributeLabel('description'),
    name: "description",
    disabled: disabled,
    required: true, <-- new attribute!
    rows: 4,
    value: group.description,
    errors: group.getErrors("description"),

}) }}
jellingsen commented 1 year ago

Thank you, I'll have a look at it.