-
-
Notifications
You must be signed in to change notification settings - Fork 612
Open
Labels
Description
Bug description
If you create a link field with a required validator, it will remove the "None" option and force you to choose a link - either a manually entered URL or select a entry from collections you specify.
If you give it the sometimes validator instead of the required validator (e.g. because you have the field hidden via display logic) it will still show the None option and allow you to select that and submit the form even if the field is visible.
Using both required and sometimes just makes the field always be required, even if hidden via display logic so isn't really possible here. I'm guessing the bug here is just that there's a check for the required validator that also needs to check for sometimes?
How to reproduce
- Create a blueprint with a link field
- Give the field the "sometimes" validator
- Try and make a new entry using this blueprint with "None" selected.
Logs
Environment
Application Name: Statamic
Laravel Version: 12.33.0
PHP Version: 8.3.29
Composer Version: 2.9.3
Environment: local-db
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: database
Database: mysql
Logs: stack / single
Mail: log
Queue: database
Session: file
Storage
public/storage: NOT LINKED
Statamic
Addons: 7
Sites: 1
Stache Watcher: Disabled (auto)
Static Caching: Disabled
Version: 5.66.0 PRO
Statamic Addons
anakadote/statamic-recaptcha: 2.0
eminos/statamic-tabs: 1.2.0
jezzdk/statamic-google-maps: 2.1.0
patrickjunod/image-select: 1.0.0
rias/statamic-redirect: 3.12.0
statamic/eloquent-driver: 4.32.0
withcandour/aardvark-seo: dev-master
Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Fieldsets: file
Form Submissions: file
Forms: file
Global Sets: file
Global Variables: file
Navigation Trees: file
Navigations: file
Revisions: file
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: fileInstallation
Fresh statamic/statamic site via CLI
Additional details
No response
Reactions are currently unavailable