Hi! I'm working on a Joomla 2.5.6 site that is connected with a Moodle 2.2.3 installation through Joomdle 0.81 so that users that register through Joomla are automatically created in Moodle. I've done some field mappings between Joomla and Moodle.
I have some problems with the country field from Moodle database (table user). No matter what I do I cannot insert more than two characters in that field, using the Joomla register form (I can insert more than 2 characters manually from phpmyadmin). I need to insert more than 2 characters because I changed the countries.php file and I've replaced the countries list with a list of local regions.
I changed the country field type from varchar(2) to varchar(50) and changed the country limit from /lib/moodlelib.php to 50, but it's not working.
(starting at line 3725 in my installation)
function truncate_userinfo($info) {
// define the limits
$limit = array(
'username' => 100,
'idnumber' => 255,
'firstname' => 100,
'lastname' => 100,
'email' => 100,
'icq' => 15,
'phone1' => 20,
'phone2' => 20,
'institution' => 40,
'department' => 30,
'address' => 70,
'city' => 120,
'country' => 50,
'url' => 255,
);
$textlib = textlib_get_instance();
// apply where needed
foreach (array_keys($info) as $key) {
if (!empty($limit[$key])) {
$info[$key] = trim($textlib->substr($info[$key],0, $limit[$key]));
}
}
return $info;
}
I believe that Moodle is somewhere limiting the amount of information that can be inserted in the database through external authentication but I don't know where. Any ideas on how to insert more than 2 characters in the country field are appreciated.