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

Width field - New items are added to YAML as strings #11035

Open
pdipatrizio opened this issue Oct 31, 2024 · 2 comments
Open

Width field - New items are added to YAML as strings #11035

pdipatrizio opened this issue Oct 31, 2024 · 2 comments

Comments

@pdipatrizio
Copy link
Contributor

pdipatrizio commented Oct 31, 2024

Bug description

The default items on a Width field are saved in YAML as numbers, but newly added items are saved as strings.

handle: column_width
  field:
    options:
      - 25
      - 33
      - '42'
      - 50
      - '58'
      - 66
      - 75
    default: '50'
    type: width
    display: 'Column width'

How to reproduce

  1. Add a Width field to a fieldset.
  2. Add new items (e.g. 42 and 58)
  3. Save
  4. View the fieldset's YAML.

Logs

No response

Environment

Environment
Application Name: Example
Laravel Version: 11.27.2
PHP Version: 8.3.12
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: Example.test
Maintenance Mode: OFF
Timezone: America/Los_Angeles
Locale: en

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

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: sendmail
Queue: sync
Session: file

Statamic
Addons: 9
Sites: 2 (Default, Customers)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.30.0 PRO

Statamic Addons
codedge/statamic-move-entries: 1.3.0
goldnead/statamic-toc: 1.5
jacksleight/statamic-miniset: 1.1.2
mitydigital/feedamic: 2.5.0
rias/statamic-color-swatches: 2.3.0
rias/statamic-link-it: 2.4.0
rias/statamic-redirect: 3.8.1
stefangalescu/statamic-heroicons: 3.0
visuellverstehen/statamic-classify: 3.0.0

Installation

Starter Kit using via CLI

Additional details

No response

@jasonvarga
Copy link
Member

Is it causing a problem?

@pdipatrizio
Copy link
Contributor Author

pdipatrizio commented Nov 4, 2024

@jasonvarga Seeing the mixed types made me worry that it would cause problems but as far as I could tell I don't think there were any. So I guess technically not a "bug" but I wanted to share it here anyways because I felt like it makes more sense for newly added items to be consistently formatted with the existing default items. FWIW, I'm checking equality in my Antlers template with ==, not ===.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants