Why are there so many missing language strings?

Why are there so many missing language strings?

by Diane Soini -
Number of replies: 3

I ran the behat tests and it appears there are a lot of errors like this:

Invalid get_string() identifier: 'course:noupdateimhelpdesk' or component 'core_role'. Perhaps you are missing $string['course:noupdateimhelpdesk'] = ''; in lang/en/core_role.php?
Invalid get_string() identifier: 'forumtips:myaddinstance' or component 'block_forumtips'. Perhaps you are missing $string['forumtips:myaddinstance'] = ''; in /var/www/html/gs_35/blocks/forumtips/lang/en/block_forumtips.php

Does Moodle test itself? Are these missing strings some kind of artifact of the tests that just need to be ignored?

Is it possible to run the tests and suppress these kinds of debugging errors and only output important errors?

Average of ratings: -
In reply to Diane Soini

Re: Why are there so many missing language strings?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes, Moodle tests itself massively, and if these strings really had been missing, then the testing would have detected it. However, that is not the problem. If you go an look at the code, you will see that those strings are there.

What the problem appears to be - we have also seen it at the Open University very intermittently, and a subtle bug in the caching. Language strings are stored in a cache to improve performance, and this bug seems to happen when the wrong data gets into the cache. The problem solves itself when the cache is refreshed.

That is what my colleagues sam and Jason found when they investigated. I can't remember if they work out any more about how that happens. However, since it only happens very occasionally, it is hard to debug. If you can find any more information about what is going on, that would be helpful.

In reply to Diane Soini

Re: Why are there so many missing language strings?

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 think this is a different problem from what Tim describes above.

There is no such string course:noupdateimhelpdesk supposed to exist in the lang/en/role.php (any why does it suggest core_role.php I don't know) in the standard Moodle. Similarly, there is no plugin like block_forumtips present in the standard Moodle distribution. And it has not been even submitted to the Plugins directory.

My best guess is that you ran the Behat tests on a heavily customized Moodle installation. You should approach authors of those customizations.

In reply to David Mudrák

Re: Why are there so many missing language strings?

by Diane Soini -

Yes, I did create some custom roles and I guess forumtips is not a core moodle plugin. So my secondary question is can you tell the behat tests not to output debugging information and only show fatal errors?