Moodle
  1. Moodle
  2. MDL-37061

invalid user->lang breaks user login and tinymce

    Details

    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      1/ edit user table, set lang to some nonsense for your admin account
      2/ login and verify the tinymce mce works by editing some forum post and frontpage description
      3/ try to change your lang to something than 'en'

      Show
      1/ edit user table, set lang to some nonsense for your admin account 2/ login and verify the tinymce mce works by editing some forum post and frontpage description 3/ try to change your lang to something than 'en'
    • Workaround:
      Hide

      In edit user profile settings - Set your language language to another and then back to English.

      OR edit lib.php and set language to always be EN.

      Show
      In edit user profile settings - Set your language language to another and then back to English. OR edit lib.php and set language to always be EN.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull 2.4 Branch:
      w49_MDL-37061_m24_invalidlang
    • Pull Master Branch:
      w49_MDL-37061_m25_invalidlang
    • Rank:
      46613

      Description

      Hi

      When using the HTML editor - instead of the words Font or Font Size

      advanced.fontdefault and advanced.font_size are displayed.

      The image editor has similar problems and the correct labels are not appearing.

      This only impacts on the Frontpage News Forum and other discussion topics - plus creating HTML page. All other implementation of the HTML editor seem to be OK.

      See http://tracker.moodle.org/browse/MDL-27493

        Issue Links

          Activity

          Hide
          James Cracknell added a comment -

          If I change the users language to another one e.g. Welsh (Cymraeg) and the language pack is loaded then it works. Change it back to English then it is OK!!!

          I can imagine I get the same issue as previously reported in http://tracker.moodle.org/browse/MDL-27493 about the mdl_users language settings and need to take a look when I am next on the server. (Monday)

          Users were imported by CSV file. Could this be the cause of the issue?

          J.

          Show
          James Cracknell added a comment - If I change the users language to another one e.g. Welsh (Cymraeg) and the language pack is loaded then it works. Change it back to English then it is OK!!! I can imagine I get the same issue as previously reported in http://tracker.moodle.org/browse/MDL-27493 about the mdl_users language settings and need to take a look when I am next on the server. (Monday) Users were imported by CSV file. Could this be the cause of the issue? J.
          Hide
          James Cracknell added a comment - - edited

          I've just noticed something different. The language default on the option drop down menu used to be Cymraeg (Welsh) which is odd as it always was in English. Now it displays English.

          Users are only created by CSV and also LDAP on the system. (I can't remember setting language with CSV - most users were created by CSV)

          To add - things were OK within courses with the HTML editor - could this be that the language default for courses overrides the personal settings.

          J.

          Show
          James Cracknell added a comment - - edited I've just noticed something different. The language default on the option drop down menu used to be Cymraeg (Welsh) which is odd as it always was in English. Now it displays English. Users are only created by CSV and also LDAP on the system. (I can't remember setting language with CSV - most users were created by CSV) To add - things were OK within courses with the HTML editor - could this be that the language default for courses overrides the personal settings. J.
          Hide
          Petr Škoda added a comment -

          Sorry, but you did not give me any new information necessary to reproduce your problem. Please make sure both the $CFG->lang and lang value in user table is correct, also make sure you have only standard languages installed without any modifications.

          Show
          Petr Škoda added a comment - Sorry, but you did not give me any new information necessary to reproduce your problem. Please make sure both the $CFG->lang and lang value in user table is correct, also make sure you have only standard languages installed without any modifications.
          Hide
          James Cracknell added a comment -

          Petr - I did say I can check the lang files on Monday - I've managed to get the remote system (via a useless system) to work.

          $CFG - English (en)

          In the database though there is a mixture of United Kingdom and en_us and En as the lang value in the user table.

          It depends if the user has been created manually, through LDAP or imported by CSV. Lang is set to co field. Using Windows Server 2008R2.

          Show
          James Cracknell added a comment - Petr - I did say I can check the lang files on Monday - I've managed to get the remote system (via a useless system) to work. $CFG - English (en) In the database though there is a mixture of United Kingdom and en_us and En as the lang value in the user table. It depends if the user has been created manually, through LDAP or imported by CSV. Lang is set to co field. Using Windows Server 2008R2.
          Hide
          Petr Škoda added a comment -

          Oh, "United Kingdom" and "En" is very wrong, only lowercase abbreviations are allowed there, please make sure to include only valid lang codes there.

          Show
          Petr Škoda added a comment - Oh, "United Kingdom" and "En" is very wrong, only lowercase abbreviations are allowed there, please make sure to include only valid lang codes there.
          Hide
          Petr Škoda added a comment -

          hohoho, I got: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in moodle25/cache/classes/helper.php on line 476

          when I inserted some very weird lang to my admin user, I am going to add a hack that cleans the user lang right after login, hopefully that should also address this issue...

          Show
          Petr Škoda added a comment - hohoho, I got: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in moodle25/cache/classes/helper.php on line 476 when I inserted some very weird lang to my admin user, I am going to add a hack that cleans the user lang right after login, hopefully that should also address this issue...
          Hide
          Petr Škoda added a comment -

          Thanks for the persistence when reporting this issue, hopefully this should resolve it. Ciao

          Show
          Petr Škoda added a comment - Thanks for the persistence when reporting this issue, hopefully this should resolve it. Ciao
          Hide
          James Cracknell added a comment -

          Hi Petr

          No problem. It is also related to another issue. I reported before (along with others) some odd things in Moodle 2.3/2.2 with the language strings cached where directories called United Kingdom etc. appeared and a long list of debug messages. I'll dig out the issue MDL-# and add them to the list. This is related, I have gone through some very old backups of databases and checked the DB itself.

          On ldap I've now switched off it obtaining the language details from Windows. I bet this is one of the causes of the problems. I've just left the default in Moodle is English and done an update on the lang field for in mdl_users to 'en'. Since doing that everything has been constant.

          It does explain why it was only certain instances of tinymce. Where the lang was forced to en in a course all would be OK. As soon as it was user settings that took priority then the problem arose if the lang field had odd entries in it.

          Thanks for your help.

          Show
          James Cracknell added a comment - Hi Petr No problem. It is also related to another issue. I reported before (along with others) some odd things in Moodle 2.3/2.2 with the language strings cached where directories called United Kingdom etc. appeared and a long list of debug messages. I'll dig out the issue MDL-# and add them to the list. This is related, I have gone through some very old backups of databases and checked the DB itself. On ldap I've now switched off it obtaining the language details from Windows. I bet this is one of the causes of the problems. I've just left the default in Moodle is English and done an update on the lang field for in mdl_users to 'en'. Since doing that everything has been constant. It does explain why it was only certain instances of tinymce. Where the lang was forced to en in a course all would be OK. As soon as it was user settings that took priority then the problem arose if the lang field had odd entries in it. Thanks for your help.
          Hide
          Petr Škoda added a comment -

          Thanks for the info, I will look at the auth plugins too and make sure nothing wrong gets through to moodle database.

          Show
          Petr Škoda added a comment - Thanks for the info, I will look at the auth plugins too and make sure nothing wrong gets through to moodle database.
          Hide
          James Cracknell added a comment -

          Hi This will also solve MDL-27493 and MDL-29228. I know both are closed - but that is why the problem could not be reproduced. I know we had a bit of talk on the forums about the joys of Windows as well at time! It's what I am forced to use...

          I did get the error you had with memory last night (with my personal account), but only when I set Developer Debug on. I had to manually edit the mdl_config table to sort it out. Even resetting the iis service or increasing the memory available to PHP had no impact. Without debug on, all was OK. See * for an idea.

          At last this has been the cause of my only real headache with Moodle. Typical it was Windows/LDAP and/or CSV messing things up - manual account creation was fine

          *Would it be a good idea for the future to have a script that just resets certain fields in the Moodle tables that could be downloaded - put into the web directory and would just sort things out in an emergency?

          J.

          Show
          James Cracknell added a comment - Hi This will also solve MDL-27493 and MDL-29228 . I know both are closed - but that is why the problem could not be reproduced. I know we had a bit of talk on the forums about the joys of Windows as well at time! It's what I am forced to use... I did get the error you had with memory last night (with my personal account), but only when I set Developer Debug on. I had to manually edit the mdl_config table to sort it out. Even resetting the iis service or increasing the memory available to PHP had no impact. Without debug on, all was OK. See * for an idea. At last this has been the cause of my only real headache with Moodle. Typical it was Windows/LDAP and/or CSV messing things up - manual account creation was fine *Would it be a good idea for the future to have a script that just resets certain fields in the Moodle tables that could be downloaded - put into the web directory and would just sort things out in an emergency? J.
          Hide
          Sam Hemelryk added a comment -

          Thanks Petr, this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Petr, this has been integrated now
          Hide
          Jason Fowler added a comment -

          all works as normal with a random string in place of the language. Thanks Petr!

          Show
          Jason Fowler added a comment - all works as normal with a random string in place of the language. Thanks Petr!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Many thanks for your effort, the whole Moodle Community will be enjoying your great solutions starting now!

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Many thanks for your effort, the whole Moodle Community will be enjoying your great solutions starting now! Closing, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: