Error with language manager (Bug report)

Hi everyone. I have found an error that maybe @stephenwaite @luisuriarte @sjpadgett and @brady.miller can solve.
After upgrading to 6.1 (1) I wanted to use the language manager and got the following error (I have the interface in Spanish(Latin America)):

Query Error

ERROR: query failed: SELECT lc.cons_id, lc.constant_name, ld.def_id, ld.definition, ld.lang_id FROM lang_definitions AS ld RIGHT JOIN ( lang_constants AS lc, lang_languages AS ll ) ON ( lc.cons_id = ld.cons_id AND ll.lang_id = ld.lang_id ) WHERE lc.constant_name COLLATE utf8mb4_general_ci LIKE ? AND ( ll.lang_id = 1 OR ll.lang_id=? ) ORDER BY lc.constant_name, BINARY lc.constant_name, ld.lang_id COLLATE utf8mb4_general_ci

Error: COLLATION ‘utf8mb4_general_ci’ is not valid for CHARACTER SET ‘latin1’

/var/www/localhost/htdocs/openemr/interface/language/lang_definition.php at 216:sqlStatement
/var/www/localhost/htdocs/openemr/interface/language/language.php at 96:require_once(/var/www/localhost/htdocs/openemr/interface/language/lang_definition.php)

This has happened to me in 2 installations with xampp (PHP 7.4) in Win 10.
The same error i got in the following official demo:
https://demo.openemr.io/openemr/interface/main/tabs/main.php?token_main=QeUmnwOBaDWMYQUsjFB3ZT1mv2IfpXc2dUdsmQw8

For now I have solved it, renaming lang_definition.php and lenguaje.php and copying instead those of version 6.0.0(4).

thanks for everyone’s effort

$db_encoding = ‘utf8mb4’;
in sites/default/sqlconf.php

Thanks sjpadgett. I try it and comment.

Hi, Unfortunately it didn’t work, still the same error.

Query Error

ERROR: query failed: SELECT lc.cons_id, lc.constant_name, ld.def_id, ld.definition, ld.lang_id FROM lang_definitions AS ld RIGHT JOIN ( lang_constants AS lc, lang_languages AS ll ) ON ( lc.cons_id = ld.cons_id AND ll.lang_id = ld.lang_id ) WHERE lc.constant_name COLLATE utf8_general_ci LIKE ? AND ( ll.lang_id = 1 OR ll.lang_id=? ) ORDER BY lc.constant_name, BINARY lc.constant_name, ld.lang_id COLLATE utf8_general_ci

Error: COLLATION ‘utf8_general_ci’ is not valid for CHARACTER SET ‘latin1’

C:\xampp\htdocs\HCE\interface\language\lang_definition.php at 216:sqlStatement
C:\xampp\htdocs\HCE\interface\language\language.php at 96:require_once(C:\xampp\htdocs\HCE\interface\language\lang_definition.php)

Hi Martin,
I suppose I could have been more specific. I was trying to point out where you need to handle collation setup and should have gone into more detail.

Since you are not using any flavor of utf8 you should disable the utf8 flag in sqlconf.php e.g:
$disable_utf8_flag = true;
and completely remove the $db_encoding = 'utf8mb4';

For some reason I thought by now everyone could read my mind! Guess not…:slight_smile:

Hi @sjpadgett
I have updated to version 7.0.2 and I have the same error, deactivating the option in sqlconfig has not solved it, where should I delete the db_encoding?
thank you so much

[image]

Hola… Un placer… me sumé hace un par de hora a la comunidad ya que tengo un pequeño cliente … tuve el mismo error y lo solucioné con este foro… en mi caso con la versión 7