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

get_record MUST_EXIST should not throw dml_exception

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 2.3, 3.4.3, 3.5
    • Database SQL/XMLDB
    • Any
    • MOODLE_23_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Hide

      0. You need debugging turned on so you can see what kind of exception it is.

      1. Visit a page which uses get_record with MUST_EXIST, and pass in a parameter that isn't valid:

      http://your.server/root/group/index.php?id=999999

      2. Verify that the error message you get contains a helpful explanation such as the one above and that it isn't a dml_exception.

      Show
      0. You need debugging turned on so you can see what kind of exception it is. 1. Visit a page which uses get_record with MUST_EXIST, and pass in a parameter that isn't valid: http://your.server/root/group/index.php?id=999999 2. Verify that the error message you get contains a helpful explanation such as the one above and that it isn't a dml_exception.

      When you call get_record with MUST_EXIST this currently throws a dml_exception. This should actually throw a different exception because it does not indicate a database error.

      For example the exception could be a must_exist_exception and it could contain a default language string such as:

      'Required information not found in database. This can occur if you follow an outdated or incorrect link.'

            Unassigned Unassigned
            quen Sam Marshall
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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