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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

      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 !=''

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jonathan Jonathan Harker
              Reporter:
              jonathan Jonathan Harker
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: