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.

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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              jonathan Jonathan Harker added a comment -

              Applied trivial patch to HEAD, MOODLE_19_STABLE and MOODLE_18_STABLE.

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

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: