getgrav / getgrav/grav-plugin-admin
Validation of required upload field causes Runtime Error
- Dominant language
- PHP
- Stars
- 377
- Forks
- 225
- Avg merge
- 11h 51m
- Merged PRs (30d)
- 4
Description
Grav v1.6.26 - Admin v1.9.15
When I set filepicker, date or also other fields in blueprint with `validate.required: true` and leave them empty in the admin panel is causes a Runtime Error after hitting the save button:

But in this case the file "text.html.twig" exists despite the error claims otherwise. Setting `validate.required: false` makes the error disappear. This error exists only appears on modular pages.
Relevant blueprint code:
``` yaml
header.img:
type: filepicker
label: Logo
preview_images: true
accept:
- .jpg
- .png
validate:
required: true
```
Contributor guide
Research direction
Reproduce the admin save on a modular page using the shown blueprint with validate.required: true, leaving the filepicker empty, and compare it with required: false. Start by tracing validation for modular-page blueprints and the reported reference to text.html.twig; done means an empty required upload shows a validation message instead of a Runtime Error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100