Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form blueprint field config is missing default values #10077

Closed
martyf opened this issue May 15, 2024 · 0 comments · Fixed by #10088
Closed

Form blueprint field config is missing default values #10077

martyf opened this issue May 15, 2024 · 0 comments · Fixed by #10088

Comments

@martyf
Copy link
Contributor

martyf commented May 15, 2024

Bug description

Saving a 4.x Form blueprint in 5.x strips out configuration properties when their value is the default value - see #9685

For example setting the Visibility of a field to be visible results in the visibility property being removed from the Blueprint YAML. Setting it to Read Only correctly saves it as readonly.

However when looking at the fields output within Antlers on the front end, these missing properties (i.e. visibility: visible) are no longer included.

Another PR was made that adjusted this for field config (#9010) however does not seem to apply to frontend forms.

How to reproduce

  1. Clone the demo repo (https://github.com/martyf/statamic-form-field-config-example)
  2. This is a Statamic 5 install, with a Form blueprint from Statamic 4
  3. View the site in the front end

You should see the following output:

Field: contact_name is visible
Field: contact_email is visible
Field: contact_number is visible
Field: contact_message is visible
Field: assets_field is visible
  1. Go to the CP (make a user first, obviously)
  2. Edit the Blueprint via the CP - and Save.

You will now see:

Field: contact_name is
Field: contact_email is
Field: contact_number is
Field: contact_message is
Field: assets_field is

The default value of visibility is not being included.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.7.0
PHP Version: 8.3.7
Composer Version: 2.7.6
Environment: local
Debug Mode: ENABLED
URL: formtest.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.1.0 Solo

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@duncanmcclean duncanmcclean changed the title [5.x] Form blueprint field config is missing default values Form blueprint field config is missing default values May 15, 2024
@duncanmcclean duncanmcclean self-assigned this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants