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

Error with date field #89

Closed
edalzell opened this issue Oct 20, 2021 · 8 comments · Fixed by #90
Closed

Error with date field #89

edalzell opened this issue Oct 20, 2021 · 8 comments · Fixed by #90

Comments

@edalzell
Copy link
Contributor

Description

I have a date field (sql type date) with this in the blueprint:

        handle: birthdate
        field:
          mode: single
          time_enabled: false
          time_required: false
          earliest_date: '1900-01-01'
          full_width: false
          inline: false
          columns: 1
          rows: 1
          display: Birthdate
          type: date
          icon: date

When I try to load a model detail page in the CP I get a carbon error: CleanShot 2021-10-19 at 19 31 43@2x

Steps to reproduce

  1. have a date field in the blueprint
  2. try to load a model in the CP

Environment

Statamic 3.2.16 Pro
Laravel 8.64.0
PHP 8.0.11
aryehraber/statamic-captcha 1.5.2
aryehraber/statamic-uuid 2.0.3
doublethreedigital/runway 2.1.27
edalzell/download dev-main
edalzell/forma 1.0
jonassiewertsen/statamic-livewire 2.7.0
statamic/seo-pro 2.3.2
transformstudios/events 2.2.2
transformstudios/front 1.7.1
transformstudios/gated dev-main
transformstudios/magic-link dev-main
transformstudios/memorial dev-feature/orphan-portal
transformstudios/price-of dev-feature/orphan-portal
transformstudios/review 3.1
transformstudios/simple dev-main
transformstudios/stripe dev-main
transformstudios/takeover-redirects dev-main
@duncanmcclean
Copy link
Member

Have you cast the date field to anything in your Eloquent model?

@edalzell
Copy link
Contributor Author

Yes, immutable_date, but error occurs if I remove that too.

@duncanmcclean
Copy link
Member

What if you change the date casting to just being date? Still an issue?

@edalzell
Copy link
Contributor Author

It's all date fields. If I take them out it works.

@duncanmcclean
Copy link
Member

Hmm, odd. I'll take a look when I have some time over the next few days, if that's okay?

@edalzell
Copy link
Contributor Author

Hmm, odd. I'll take a look when I have some time over the next few days, if that's okay?

It's a blocker for us, but I understand. I'll take out those fields for now so the CP at least loads.

@duncanmcclean
Copy link
Member

Sorry! I'll see if I can fit it in this evening but I'm pretty busy this evening! If you can figure it out before me, PRs are welcome!

@edalzell
Copy link
Contributor Author

Sorry! I'll see if I can fit it in this evening but I'm pretty busy this evening! If you can figure it out before me, PRs are welcome!

Yup, if I can fix, I will

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

Successfully merging a pull request may close this issue.

2 participants