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

After upgrading to Craft 3.2 I have problems saving entries with a date field. #4508

Closed
handplant opened this issue Jul 10, 2019 · 11 comments
Closed

Comments

@handplant
Copy link

Description

After saving a change in an entry with date field, the following message appears:

Internal Server Error
Server Error

The web logfile contains the following:
PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\x98\x8E? ...' for column mysite.revisions.snapshot at row 1 in /vendor/yiisoft/yii2/db/Command.php:1290

Steps to reproduce

  1. Edit an entry with date field
  2. Change something and click "Update Entry"

Additional info

  • Craft version: Craft Pro 3.2.0
  • PHP version: 7.2.14
  • Database driver & version: MySQL 5.5.5
@handplant
Copy link
Author

Okay. I'm sorry. That was my problem. I have emotjis in the text which cause the error! :( Please close the issue!

@brandonkelly
Copy link
Member

You had emojis in the date field? Or a different field type?

@handplant
Copy link
Author

No, a Plain Text Field.

@brandonkelly
Copy link
Member

brandonkelly commented Jul 10, 2019

Emojis should be getting converted to shortcodes in the backend. Do you remember which emoji character(s) were triggering this so we can look into it?

@brandonkelly
Copy link
Member

I was able to reproduce this by temporarily disabling the emoji-shortcode conversion, and updated the UI to do a better job identifying the issue:

A heads-up display explaining why a draft couldn’t be saved

Hopefully that’ll save people some troubleshooting time in the future.

@narration-sd
Copy link
Contributor

narration-sd commented Jul 11, 2019 via email

@handplant
Copy link
Author

I have the problem in several installations after updating to 3.2. In version 3.1.x I have no problems. What can I do? How can I activate emoji-shortcode?

@brandonkelly
Copy link
Member

@handplant it just happens automatically. What exactly are you doing?

@handplant
Copy link
Author

@brandonkelly Nothing special. Update to 3.2 without problem. After that I try to save this emoji 😃 in a plain text field. The draft is saved in the background without problems. After click "Update entry" the following error occurs: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\x98\x80 \xF0...' for column mysite.revisions.snapshot.

@brandonkelly
Copy link
Member

Doh, I guess I should have tested actually saving entries with emojis, rather than just ensuring draft saving was working :)

Just fixed this for the next release. To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#43d22b4403fb555e1d8db3efc4b9978071b1deb5 as 3.2.0",
  "...": "..."
}

Then run composer update.

@khalwat
Copy link
Contributor

khalwat commented Apr 17, 2020

I'm experiencing this too: nystudio107/craft-seomatic#606 (comment)

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

4 participants