osem icon indicating copy to clipboard operation
osem copied to clipboard

500 error when submitting a proposal using emoji in the title

Open Mariatta opened this issue 5 years ago • 2 comments

I'm submitting a ..

  • [x] Bug Report
  • [ ] Feature Request

Current behavior: I tried submitting a talk proposal to SeaGL (https://osem.seagl.org/conferences/seagl2020) and my talk title included an emoji. When I tried submitted the talk, I got a 500 error. When I removed the emoji from the title, it got submitted without issue.

Expected correct behavior:

It would be great if emoji would be allowed in the title. Alternatively, it would also be great if it would tell me that I should not include emoji in the title, instead of showing me the 500 error.

Steps to reproduce:

  1. Go to https://osem.seagl.org/conferences/seagl2020, and create a new proposal
  2. Enter a talk title including emoji.
  3. Submit the talk -> 500 error
  4. Go back, and remove emoji from the title.
  5. Submit the talk --> 200 OK

Other information:

Mariatta avatar Jul 28 '20 17:07 Mariatta

Thanks for reporting this. I've been unable to reproduce it when using PostgreSQL or SQLite, but using MySQL (as on SeaGL's instance) produces:

ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xF0\x9F\x9A\x80' for column 'title' …)

Apparently MySQL's "utf8" type doesn't actually support UTF-8. Rails 6 corrects for that in new instances, but OSEM is still using Rails 5, and existing instances still need to go through a somewhat involved migration.

AndrewKvalheim avatar Oct 29 '20 02:10 AndrewKvalheim

See https://github.com/openSUSE/open-build-service/pull/5419 for an inspiration how to fix this

hennevogel avatar Mar 07 '21 00:03 hennevogel