Language customization error in Moodle 2.1.

Language customization error in Moodle 2.1.

by Emanuel Delgado -
Number of replies: 11

Hello,

Error continues from previous 2.0.x versions when trying to customize PT language pack.

When "Checking out string into the translator", it stops at 9% with the following errors:

Debug info:
Stack trace:
  • line 396 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 878 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 920 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 191 of /admin/report/customlang/locallib.php: call to mysqli_native_moodle_database->insert_record()
  • line 61 of /admin/report/customlang/index.php: call to report_customlang_utils::checkout()
ED
Average of ratings: -
In reply to Emanuel Delgado

Re: Language customization error in Moodle 2.1.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Emanuel, are you able to re-configure your MySQL server so that it logs all SQL statements? Then you should be able to identify what string throws this error. As I commented earlier, I am unable to reproduce this bug on my machine using PostgreSQL - the Portugal (pt) language pack is checked out into the translator with no problems here...

Can somebody else here try to reproduce the behaviour?

  1. Install Portugal (pt) lang pack
  2. Try to customize it
  3. TEST: make sure that the strings are checked out and the language customization tool opens
In reply to David Mudrák

Re: Language customization error in Moodle 2.1.

by Emanuel Delgado -

Hello David,

I guess it has something to do with the mysql server configuration.

I've just installed moodle in ubuntu and it is working fine. The problem is in my windows-installed moodle.

I will look into it as soon as possible and give you feedbacka about the results.

ED

In reply to Emanuel Delgado

Re: Language customization error in Moodle 2.1.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Just guessing, make sure that the character set and collations are set correctly for your database. See the Moodle wiki docs for details.
In reply to David Mudrák

Re: Language customization error in Moodle 2.1.

by Osvaldo Pinco -

Hello All

Same error here with version 2.2.1+ (Build: 20120202 trying to customize Spanish language. I tried even with the English original set. But same happened.

PHP Version 5.3.5

MySQL 5.1.56

Character collation utf8_unicode_ci

Debug info, that I could only get using developer debugging (the highest)

Debug info:
Stack trace:
  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 893 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 935 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 190 of /admin/tool/customlang/locallib.php: call to mysqli_native_moodle_database->insert_record()
  • line 60 of /admin/tool/customlang/index.php: call to tool_customlang_utils::checkout()

Any ideas please?

In reply to Osvaldo Pinco

Re: Language customization error in Moodle 2.1.

by Jürg Hoerner -

I had a similar problem --> language customization stopped at 92% 

With debug mode developer 

Debug info: FEHLER: NULL-Wert in Spalte »original« verletzt Not-Null-Constraint
INSERT INTO mdl_tool_customlang (lang,componentid,stringid,original,master,timemodified,outdated,local,timecustomized) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9) RETURNING id
[array (
'lang' => 'de',
'componentid' => '153',
'stringid' => 'typea',
'original' => NULL,
'master' => NULL,
'timemodified' => 1329419188,
'outdated' => 0,
'local' => NULL,
'timecustomized' => NULL,
)]

Stack trace:

  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
  • line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
  • line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
  • line 190 of /admin/tool/customlang/locallib.php: call to pgsql_native_moodle_database->insert_record()
  • line 60 of /admin/tool/customlang/index.php: call to tool_customlang_utils::checkout()

 I solved it. 

The module 153 is the mrbs module. 

solution: 

1. I changemod to 0   the lang folder of the mrbs directory

2. I started the  Language customization 

--> 100% 

3. changemod to 755 of the lang folder of the mrbs dirctory

If you don't know the module, you have to do try this with other lang folders in the block or modul folder. 

Jürg Hoerner

In reply to Jürg Hoerner

Re: Language customization error in Moodle 2.1.

by Jürg Hoerner -

1. I changemod to 0   the lang folder of the mrbs directory

2.  desactivate the block mrbs 

3. I started the  Language customization 

In reply to Jürg Hoerner

Re: Language customization error in Moodle 2.1.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Well, this particular case with the MRBS block is caused by the invalid string definition in the "es" lang pack of the module. See https://github.com/davosmith/moodle-mrbs/blob/MOODLE_20_STABLE/lang/es/block_mrbs.php#L244 The line reads

$string['typea'] = NULL;

which is something the checkout code really does not expect. So, I could make it resistant to this sort of bugs but I would rather prefer if that line was removed from the block code (and thanks to Jürg's report, we now know the source of the problem is there).

I just checked with Davo Smith and I was told that the official repo for the block is at https://github.com/arborrow/moodle-block_mrbs which have this already fixed.

In reply to Jürg Hoerner

Re: Language customization error in Moodle 2.1.

by Hernan Jaime -

How can I get the debug info? I don`t know how to switch to debug mode developer :/

In reply to Jürg Hoerner

Re: Language customization error in Moodle 2.1.

by Matthias Baume -

Hi Jürg,

how exactly did you get the detailed mySQL-information in your output?

----

With debug mode developer 

Debug info: FEHLER: NULL-Wert in Spalte »original« verletzt Not-Null-Constraint
INSERT INTO mdl_tool_customlang (lang,componentid,stringid,original,master,timemodified,outdated,local,timecustomized) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9) RETURNING id
[array (
'lang' => 'de',
'componentid' => '153',
'stringid' => 'typea',
'original' => NULL,
'master' => NULL,
'timemodified' => 1329419188,
'outdated' => 0,
'local' => NULL,
'timecustomized' => NULL,
)]

----

When I activate the more detailed bug reports in the moodle configuration file, I only get the stack trace, but not the mySQL-info.

Thank you very much

Matthias Baume

In reply to Osvaldo Pinco

Re: Language customization error in Moodle 2.1.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
I just tried to reproduce this but I failed. For me, the "es" language pack is checked out correctly. Was it "Spannish - International" lang pack? Have you got any contrib extension installed?
In reply to Emanuel Delgado

Re: Language customization error in Moodle 2.1.

by Rasmus Prentow -

I have the same problem.

I'm trying to load in a danish language pack. 

Btw. mine stops at 89%. 

 

Found this in log

 

 [Wed Jul 27 14:50:31 2011] [error] [client 173.245.53.105] Default exception handler: Error writing to database Debug: Incorrect string value: '\\xE6ste b...' for column 'original' at row 1, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da

INSERT INTO mdl_report_customlang (lang,componentid,stringid,original,master,timemodified,outdated,local,timecustomized) VALUES(                                                  ?,?,?,?,?,?,?,?,?), referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] [array (, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 0 => 'da',, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 1 => '173',, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 2 => 'help_lock_suspend',, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 3 => 'Quickpay skal kun have fjernet sin mulighed for at suspendere/aktivere brugere hvis de manuelt er blevet suspenderet ell er aktiveret. For eksempel hvis en bruger er suspenderet grundet snyd skal quickpays mulighed for aktivering fjernes, ellers bliver den automatisk fjernet ved n\xe6ste betaling',, referer : http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 4 => 'Quickpay skal kun have fjernet sin mulighed for at suspendere/aktivere brugere hvis de manuelt er blevet suspenderet ell er aktiveret. For eksempel hvis en bruger er suspenderet grundet snyd skal quickpays mulighed for aktivering fjernes, ellers bliver den automatisk fjernet ved n\xc3\xa6ste betaling',, ref erer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 5 => 1311770863,, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 6 => 0,, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 7 => NULL,, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] 8 => NULL,, referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] )], referer: http://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] * line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown, referer: http://www.innowell.net/studie/admin/report/cus tomlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] * line 878 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end(), referer: http://www.innowell.net /studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] * line 920 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw(), referer: h ttp://www.innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] * line 191 of /admin/report/customlang/locallib.php: call to mysqli_native_moodle_database->insert_record(), referer: http://www .innowell.net/studie/admin/report/customlang/index.php?lng=da
[Wed Jul 27 14:47:43 2011] [error] [client 173.245.53.105] * line 61 of /admin/report/customlang/index.php: call to report_customlang_utils::checkout(), referer: http://www.innowell.net/s tudie/admin/report/customlang/index.php?lng=da
 
 
Sorry for the confusing log, but seems like special characters not correctly encoded (bad me) is the problem.