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: Exception: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value #21

Closed
chriswthomson opened this issue Oct 11, 2022 · 3 comments

Comments

@chriswthomson
Copy link

Trying to embed

https://www.youtube.com/watch?v=W2omjkNmse4

Throws this error:

Error: Exception: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xCC\x88dens...' for column db.textformatter_video_embed.embed_code at row 1 (in WireDatabasePDOStatement.php line 168)

#0 WireDatabasePDOStatement.php (168): PDOStatement->execute(NULL)
#1 WireDatabasePDOStatement.php (148): WireDatabasePDOStatement->executeDebug(NULL)
#2 site/modules/TextformatterVideoEmbed/TextformatterVideoEmbed.module (306): WireDatabasePDOStatement->execute()
#3 site/modules/TextformatterVideoEmbed/TextformatterVideoEmbed.module (235): TextformatterVideoEmbed->getNewEmbedCode('https://www.you...', 'w2omjknmse4', 'https://www.you/...', true)
#4 site/modules/TextformatterVideoEmbed/TextformatterVideoEmbed.module (472): TextformatterVideoEmbed->getEmbedCode('https://www.you...', 'w2omjknmse4', 'ht

This appears to be caused by the ö in the video title.

Can this be remedied? This is on version 2.0.2.

@iamwebrocker
Copy link

I just embedded the video url on my site as a test -- it works fine.

grafik

grafik

Tested on ProcessWire 3.0.200 and VideoEmbed 2.0.2

@chriswthomson
Copy link
Author

Hi @iamwebrocker,

Thanks - just tested this on a more recent site and had no issues, this issue occurred on an older site I'd just upgraded from 2.8 to 3. I suspect database collation. I'll investigate further and will likely close if I can resolve easily.

Cheers,

Chris

@chriswthomson
Copy link
Author

Yep the collation for the module's table was being set automatically as latin1_swedish_ci. I changed this to utf8_general_ci and that has resolved the issue.

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

2 participants