- Posts: 36
Joomdle 1.0 Installation
problem with cyrillic names
- Iliya
-
Topic Author
- Offline
- Junior Member
-
Less
More
9 years 5 months ago - 9 years 5 months ago #1
by Iliya
problem with cyrillic names was created by Iliya
Hi!
I have last moodle (3.1.3) - joomla (3.6.4) - joomdle (1.0.
versions.
Then I created user (from joomla admin) in english all worked fine.
But then I try to create user (from joomla admin or something else) with cyrillic name (NOT username or login), Дмитрий for example, joomdle create moodle user with all empty poles (empty name, empty surname, empty email (!), except login - login filled by user login).
I have last moodle (3.1.3) - joomla (3.6.4) - joomdle (1.0.
Then I created user (from joomla admin) in english all worked fine.
But then I try to create user (from joomla admin or something else) with cyrillic name (NOT username or login), Дмитрий for example, joomdle create moodle user with all empty poles (empty name, empty surname, empty email (!), except login - login filled by user login).
Last edit: 9 years 5 months ago by Iliya.
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
9 years 5 months ago #2
by Antonio Durán
Replied by Antonio Durán on topic problem with cyrillic names
Thanks for the bug report. I tested and can confirm the problem.
I will investigate the issue to try to find a fix for it, and get back to you.
I will investigate the issue to try to find a fix for it, and get back to you.
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
9 years 4 months ago #3
by Antonio Durán
Replied by Antonio Durán on topic problem with cyrillic names
Can you tell us which PHP version are you running?
It seems the problem may be related to that...I tested in 5.27 and 7.0.8 and it did not work.
I tested on 5.5.9 and it works fine.
It seems the problem may be related to that...I tested in 5.27 and 7.0.8 and it did not work.
I tested on 5.5.9 and it works fine.
Please Log in or Create an account to join the conversation.
- Iliya
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 36
9 years 4 months ago #4
by Iliya
Replied by Iliya on topic problem with cyrillic names
PHP Version 5.6.28-1
Please Log in or Create an account to join the conversation.
- Iliya
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 36
9 years 4 months ago #5
by Iliya
Replied by Iliya on topic problem with cyrillic names
we changed php on 5.5.38-4 and it's still not working 
maybe there's no relation with php version? )
maybe there's no relation with php version? )
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
9 years 4 months ago #6
by Antonio Durán
Replied by Antonio Durán on topic problem with cyrillic names
Thanks for the info. Can you try a lower version? 5.5.38-4 is higher thatn 5.5.9.
Please Log in or Create an account to join the conversation.
- Iliya
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 36
9 years 4 months ago #7
by Iliya
Replied by Iliya on topic problem with cyrillic names
I have some notice in administrator/index.php?option=com_joomdle&view=users
Maybe it will help.
Notice: Undefined index: in /.../administrator/components/com_joomdle/helpers/content.php on line 576
Notice: Undefined index: in /.../administrator/components/com_joomdle/helpers/content.php on line 585
Maybe it will help.
Notice: Undefined index: in /.../administrator/components/com_joomdle/helpers/content.php on line 576
Notice: Undefined index: in /.../administrator/components/com_joomdle/helpers/content.php on line 585
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
9 years 4 months ago - 9 years 4 months ago #8
by Antonio Durán
Replied by Antonio Durán on topic problem with cyrillic names
I think problem is with PHP version.
I have downloaded simple xmlrpc client and server at:
code.runnable.com/UnEjkT04_CBwAAB4/how-t...mlrpc-client-for-php
And modified them to use Дмитрий as name.
- Scripts don't work in PHP 7 or 5.6.27. When I pass Дмитрий as an argument, it fails with:
Array ( [faultString] => parse error. not well formed. error occurred at line 7, column 11, byte index 131 [faultCode] => -32700 )
- Scripts work correctly in PHP 5.5.9
It seems problem is the same with cyrilic and farsi chars, but not with spanish, like Ñ.
I have downloaded simple xmlrpc client and server at:
code.runnable.com/UnEjkT04_CBwAAB4/how-t...mlrpc-client-for-php
And modified them to use Дмитрий as name.
- Scripts don't work in PHP 7 or 5.6.27. When I pass Дмитрий as an argument, it fails with:
Array ( [faultString] => parse error. not well formed. error occurred at line 7, column 11, byte index 131 [faultCode] => -32700 )
- Scripts work correctly in PHP 5.5.9
It seems problem is the same with cyrilic and farsi chars, but not with spanish, like Ñ.
Last edit: 9 years 4 months ago by Antonio Durán.
Please Log in or Create an account to join the conversation.
- Iliya
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 36
9 years 4 months ago #9
by Iliya
Replied by Iliya on topic problem with cyrillic names
I found this problem in runet.
Someone told that we need manual encode in utf-8
xmlrpc_encode_request("say_hello", array('John'));
so it seems, that it need to be like:
$request = xmlrpc_encode_request("say_hello", array('John'), array('encoding'=>'UTF-8','escaping'=>'markup'));
and you need to add utf8 somewhere in xmlrpc_decode
Can you try this solution?
Someone told that we need manual encode in utf-8
xmlrpc_encode_request("say_hello", array('John'));
so it seems, that it need to be like:
$request = xmlrpc_encode_request("say_hello", array('John'), array('encoding'=>'UTF-8','escaping'=>'markup'));
and you need to add utf8 somewhere in xmlrpc_decode
Can you try this solution?
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7909
9 years 4 months ago #10
by Antonio Durán
Replied by Antonio Durán on topic problem with cyrillic names
Hi.
Thank you very much for the info. I have tested, and indeed, it seems to solve the problem.
I needed to add the code to client and server to make it work.
So, we would need to add the changes to Joomdle, although for that I will need to do good testing. It is a very important change, as it would modify how web services are handled.
I have tested doing these changes in Joomdle, and it seems to be working fine.
If you want to make the changes now to start testing, here they are:
File administrator/components/com_joomdle/helpers/content.php
Function: get_request
You need to add 'escaping'=>'markup' to all xmlrpc_encode_request calls. For example:
We had:
So now it would be:
File: components/com_joomdle/controllers/ws.xmlrpc.php
Function: server
At the end, change:
By:
File: moodle/auth/joomdle/auth.php
Function: call_method_fgc and call_method_curl
At the start, change:
By:
I also checked Moodle XMLRPC server code, and found that in fact 'escaping'=>'markup' was added some time ago after I submitted a different problem with XMLRPC and latin chars on Moodle 3.1, Weird when you google something and find that you wrote the first result
Please test the changes and let me know how they work for you. I will do some good testing in the next days too, to make sure this does not cause any problems.
Thank you very much for the info. I have tested, and indeed, it seems to solve the problem.
I needed to add the code to client and server to make it work.
So, we would need to add the changes to Joomdle, although for that I will need to do good testing. It is a very important change, as it would modify how web services are handled.
I have tested doing these changes in Joomdle, and it seems to be working fine.
If you want to make the changes now to start testing, here they are:
File administrator/components/com_joomdle/helpers/content.php
Function: get_request
You need to add 'escaping'=>'markup' to all xmlrpc_encode_request calls. For example:
We had:
Code:
$request = xmlrpc_encode_request("joomdle_".$method, array (), array ('encoding' => 'utf-8'));
Code:
$request = xmlrpc_encode_request("joomdle_".$method, array (), array ('encoding' => 'utf-8', 'escaping'=>'markup'));
File: components/com_joomdle/controllers/ws.xmlrpc.php
Function: server
At the end, change:
Code:
$response = xmlrpc_server_call_method($xmlrpc_server, $request_xml, '');
Code:
$response = xmlrpc_server_call_method($xmlrpc_server, $request_xml, '', array('encoding'=>'UTF-8','escaping'=>'markup'));
File: moodle/auth/joomdle/auth.php
Function: call_method_fgc and call_method_curl
At the start, change:
Code:
$options = array ();
Code:
$options = array ('encoding' => 'utf-8', 'escaping'=>'markup');
I also checked Moodle XMLRPC server code, and found that in fact 'escaping'=>'markup' was added some time ago after I submitted a different problem with XMLRPC and latin chars on Moodle 3.1, Weird when you google something and find that you wrote the first result
Please test the changes and let me know how they work for you. I will do some good testing in the next days too, to make sure this does not cause any problems.
Please Log in or Create an account to join the conversation.