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

Date field with the name "date" in Blueprint results in nothing being saved #2687

Closed
2 tasks done
schwartzmj opened this issue Oct 19, 2020 · 3 comments
Closed
2 tasks done

Comments

@schwartzmj
Copy link
Contributor

Bug Description

Creating a Date field with the name "date" in a Blueprint results in nothing being saved when you pick a date and publish the changes.

How to Reproduce

Create a collection. Add a Date field with the name "date". Create a new entry, pick a date, save. Refresh and the date will still be set to the default of the current date because nothing was saved.

Environment

Statamic 3.0.19 Solo
Laravel 7.28.4
PHP 7.4.9
statamic/ssg 0.2.0

Install method (choose one):
I tested via two methods. The starter kit I used was the Blog starter kit. I noticed that the Blog collection works correctly with the "date" field, but creating a new collection with a "date" field does not work as described above.

  • Fresh install from statamic/statamic
  • Starter kit
@jasonvarga
Copy link
Member

The date field is reserved for literally the "date" feature.

You need to enable dates in the collection settings.

@schwartzmj
Copy link
Contributor Author

schwartzmj commented Oct 19, 2020

The date field is reserved for literally the "date" feature.

You need to enable dates in the collection settings.

I ended up figuring this out. Do you think it would be beneficial if this was mentioned in the docs (either directly on the Date Field Type page or some other page that lists all the reserved field type names) and/or if the CMS gave you some notification of it instead of failing silently? Maybe I just missed something.

Same for any other reserved fields that may be out there.

@duncanmcclean
Copy link
Member

duncanmcclean commented Oct 21, 2020

There's currently an issue over on the documentation repo talking about documenting some of Statamic's 'reserved words'.

statamic/docs#236

I'm closing this issue as it isn't technically a 'bug', just an undocumented gotcha.

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

No branches or pull requests

3 participants