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

Moodle cannot create a new record on user table when a new LDAP entry wants to authenticate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.8.8, 1.9.4
    • 1.8.5, 1.8.6, 1.8.7, 1.9, 1.9.1, 1.9.2, 1.9.3
    • Authentication
    • None
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • cvs:/lib/moodlelib.php
    • Easy

      Environment: a new LDAP entry try to authenticate for the first time in Moodle and still there isn't a record in mdl_user table.

      When this new user try to authenticate, authenticate_user_login function is called. If the credentials are correct, it search the correct record in mdl_user table without success and it calls create_user_record.
      This function try to create a new record, but this is the error message:

      Field 'city' doesn't have a default value

      INSERT INTO mdl_user ( AUTH, CONFIRMED, MNETHOSTID, USERNAME, FIRSTNAME, LASTNAME, LANG, LASTIP, TIMEMODIFIED ) VALUES ( 'ldap', 1, 1, 'd.eliseo', 'Donato', 'Eliseo', 'it_utf8', '10.250.1.21', 1229596730 )
      line 1425 of lib/dmllib.php: call to debugging()
      line 2603 of lib/moodlelib.php: call to insert_record()
      line 2787 of lib/moodlelib.php: call to create_user_record()
      line 126 of login/form.php: call to authenticate_user_login()

      infact City Field is a nonull param as you see in cvs:/lib/db/install.xml without default value

      Solution: adding something like:
      $newuser->city = '';
      in create_user_record function in cvs:/lib/moodlelib.php

            skodak Petr Skoda
            fairsayan Domenico Pontari (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.