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

Fields not read from external database

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.1, 1.7.2, 1.8
    • Component/s: Authentication, Enrolments
    • Labels:
      None
    • Environment:
      Windows XP, MySQL 5.0, MSSQL2000, Moodle 1.7
    • Database:
      MySQL, Microsoft SQL
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      When using external authentication I found out that the authentication module did not retrieve the database fields from the server.

      I had to change line 110 in auth/db/lib.php from:
      $result["$field"] = addslashes(stripslashes($rs->fields[0]));

      to:
      $result["$field"] = addslashes(stripslashes($rs->fields[$pcfg["field_map_$field"]]));

      After that authentication with the external database worked fine.

      I also had a similar problem in the database enrolment module (enrol/database/enrol.php) where I also had to change the field access from index to id.

      http://moodle.org/mod/forum/discuss.php?d=59540

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  4 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    17/Jan/07