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

question_has_capability_on() gives misleading error if question not found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.3.6, 4.4.2
    • 4.3.5, 4.4.2
    • Questions

      If question_has_capability_on() is called with a question id that doesn't exist in the database it throws a coding exception: "Invalid context id specified context::instance_by_id()".

      This is accurate, but it's not very helpful as it's the result of passing null as the context id. It may be better if there were a check that $question is not false before continuing, and a coding_exception explaining the real reason why it failed.

            maherne Michael Aherne
            maherne Michael Aherne
            Paul Holden Paul Holden
            Tim Hunt Tim Hunt
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 minutes
                4m

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