Moodle
  1. Moodle
  2. MDL-20114

Moodle does not send out new password emails (in admin/cron.php) when running on some databases.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 1.9.5
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Found using Moodle with PostgreSQL 8.3 - will also be a problem for any other SQL-92 compliant RDBMS that does not like implicit type casts.
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      12947

      Description

      The code in admin/cron.php to email out new passwords to users currently compares a text field to an integer, which is an implicit type cast that results in an error in PostgreSQL 8.3 or higher. Quoting the integer fixes the problem:

      WHERE p.name='create_password' AND p.value=1 AND u.email !=''

      should be

      WHERE p.name='create_password' AND p.value='1' AND u.email !=''

        Issue Links

          Activity

          Hide
          Jonathan Harker added a comment -

          Applied trivial patch to HEAD, MOODLE_19_STABLE and MOODLE_18_STABLE.

          Show
          Jonathan Harker added a comment - Applied trivial patch to HEAD, MOODLE_19_STABLE and MOODLE_18_STABLE.

            People

            • Assignee:
              Jonathan Harker
              Reporter:
              Jonathan Harker
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: