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

Lack of error handling/syntax exception configuring AI providers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 5.0
    • 5.0
    • AI

      Visit the following URL, where 42 is any value that doesn't correspond with a stored provider record:

      http://moodle.internal/master/ai/configure.php?id=42
      

      See the following:

      Exception - Syntax error
       
      More information about this error
      Debug info:
      Error code: generalexceptionmessage
      Stack trace:
       
          line 60 of /ai/configure.php: JsonException thrown
          line 60 of /ai/configure.php: call to json_decode()
       
      Output buffer: <br /> <b>Warning</b>: Attempt to read property "provider" on bool in <b>/opt/moodle/master/src/ai/configure.php</b> on line <b>57</b><br /> <br /> <b>Deprecated</b>: explode(): Passing null to parameter #2 ($string) of type string is deprecated in <b>/opt/moodle/master/src/ai/configure.php</b> on line <b>57</b><br /> <br /> <b>Warning</b>: Attempt to read property "config" on bool in <b>/opt/moodle/master/src/ai/configure.php</b> on line <b>60</b><br /> <br /> <b>Deprecated</b>: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in <b>/opt/moodle/master/src/ai/configure.php</b> on line <b>60</b><br /> 
      

      The API call to ::get_provider_records(...) (plural) is awkward when we are passing the primary key as the filter, and the lack of error handling produces the above

            pholden Paul Holden
            pholden Paul Holden
            Matt Porritt Matt Porritt
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            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 - 24 minutes
                24m

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