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

Unable to save 0 (zero) as a string or integer #2129

Closed
cibgraphics opened this Issue Aug 20, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@cibgraphics

cibgraphics commented Aug 20, 2018

Describe the bug
Unable to save 0 (zero) as either a string or integer.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new fieldset
  2. Create a grid
  3. Create field with either text or integer
  4. Enter 0 (zero) as data.
  5. Save

Expected behavior
0 (zero) should be saved as either a string or an integer data to use in templates. It is not saving any data at all.

Environment details (please complete the following information):

  • Statamic Version [e.g. 2.10.4]: 2.10.4
  • Fresh Install or Upgrade: Upgrade
  • OS: OSX 10.13
  • Browser: Chrome
  • Web Server: Apache
  • PHP Version: 5.5.10

Additional context
This seems to be a regression from #845

@cibgraphics

This comment has been minimized.

cibgraphics commented Aug 20, 2018

This also is present when trying to save 1 (one)

@wesort

This comment has been minimized.

wesort commented Oct 16, 2018

I've come across this bug too.

In my context, we're creating numbered lists with leading zeros. We're setting those numbers manually to tightly control syntax so we're using a text field. The first item is "0", then "0.1", etc.
https://115.org.uk/about/principles-and-constitution

Fieldset

numbered list cp

If "0" alone is used in the text field then the .md content file omits that field completely.

Workaround

  • Manually add key: value to .md content file
  • ie: item_number: "0"
  • Not ideal as page cannot be saved by CP users as it'll remove the key: value
  • Also tested with 0  however this doesn't work in my context as we're using this field to also generate an anchor link.

Rendered page (using workaround)

numbered lists with leading zero

@jesseleite

This comment has been minimized.

Member

jesseleite commented Oct 29, 2018

Fixed in next release for both grids and replicators 👍

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