q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 629 forks source link

Added support for utf8mb4 (emoji support) #798

Open bertrandgorge opened 4 years ago

bertrandgorge commented 4 years ago

Fixes issue #791

svivian commented 4 years ago

Hi, sorry for the late reply. Thanks for the PR, from a first glance it looks great! Would you be able to make the PR against the dev branch, as that is the one for the next major version?

At the moment it appears we can only set utf8mb4 prior to starting a new Q2A instance. One thing to consider is whether to add an upgrade path for existing sites. However it may be complex, as we need to detect the MySQL version and only upgrade those on 5.5.3+. But then the upgrade would need to be done on future versions in case they upgraded their MySQL version later. We'd also need people to manually change QA_USE_UTF8MB4 after the upgrade to avoid problems.

bertrandgorge commented 4 years ago

Hello Scott, yes, I thought about the upgrade path, and I believe it's a lot of work for something people should do manually if they wish to. If you want I can make a "how to upgrade" for people who'd want to do that.

As for the dev branch, I'm not sure I know how to do that ? Should I create another PR ?

rklec commented 4 years ago

So is there any news here? Emoji support would be a really nice feature by default for q2a.

svivian commented 4 years ago

@rklec Yes I plan on merging it when I get a free moment.

svivian commented 3 years ago

Hi @bertrandgorge sorry I never got around to answering you. If you're able to create a new PR on the dev branch that would be great, thanks. Not sure how easy it would be... I think you may need to check out a fresh copy of the dev branch and re-apply the changes. (If that's too much hassle let me know and I'll try and sort it.)

rklec commented 3 years ago

Actually, you just need to click "edit" at the top right of this PR and change the branch you want to merge this in. Depending on the changes you may of course need to merge in the dev branch afterwards.

bertrandgorge commented 3 years ago

Hello @rklec I don't see that option.... @svivian if you can manage it, it would be great as I don't work on Question2Answer anymore unfortunately.

rklec commented 3 years ago

You should be able to click "edit" and then change the branch below the title after the text "1 commit into".

bertrandgorge commented 3 years ago

Got it. There's a conflict of course, coming from a refactorisation of qa-db.php...

svivian commented 3 years ago

Yeah I’ve made a lot of changes in 1.9. Don’t worry about it, I’ll try and cherry pick what I can.