Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8480

When syncronishing lang from external DB auth, it's not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.7.1, 1.8
    • Fix Version/s: 1.7.2, 1.8
    • Component/s: Authentication
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      I've defined one db authentication in my Moodle server. One of the fields I've defined to be syncronished is the user lang.

      All my test users (in external DB) have es_utf8 defined but, when I log into Moodle, such lang is ignored and they get en_utf8 (the default site lang).

      The responsible line seems to be create_user_record() in moodlelib.php. There is one line that says:

      $newuser->lang = $CFG->lang;

      just before inserting the new user record. I would:

      1) Only apply $CFG->lang if $newuser->lang is empty.
      2) Check, before insert, that the $newuser->lang information is a valid and installed lang. If not, default to $CFG->lang

      Ciao

      P.S.: I haven't reviewed if this also happens in HEAD but I've marked it as target too!

        Attachments

          Activity

            People

            Assignee:
            lazyfish Yu Zhang
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Tester:
            Nobody Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              30/Mar/07