-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
fix(DB): added charset to DB Params #6153
Conversation
I like the new charset config. We have also one more charset config that for setting via params. https://github.com/degoya/kirby/blob/db-fix/src/Database/Database.php#L569 But I can't decide which one we should to use |
i would prefer |
@afbora I think you found the correct line to set this. If we set it there, the additional definition in the DB class could just return null as default and would then automatically fall back to the value set in the Database class. |
You're right @bastianallgeier I think we should implement like that $parts[] = 'charset=' . ($params['charset'] ?? Config::get('db.charset', 'utf8mb4')); https://github.com/getkirby/kirby/blob/develop-minor/src/Database/Database.php#L569 |
@bastianallgeier @afbora wouldn't the opposite make more sense? Keep the |
But |
But my understanding is that
|
Ah sorry, I see your point. If someone sets explicit |
Then I would do 'charset' => Config::get('db.charset', null) https://github.com/degoya/kirby/blob/db-fix/src/Database/Db.php#L51 And $parts[] = 'charset=' . ($params['charset'] ?? 'utf8mb4'); https://github.com/degoya/kirby/blob/db-fix/src/Database/Database.php#L569 |
@distantnative yep, that's how I would solve it too. @degoya do you want to fix it in your PR or should we take over? |
Fix Database Problem with Emojis like 🦉📌
Kirby was not able to display or save Emojis like 🦉📌 to the Database. The reason was the wrong charset, the problem is that the charset is'nt loaded to params from the config.
Fixes
loading charset from config to DB params