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

Error: coding_exception not found in user_competency_plan

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.3
    • 3.1, 3.1.2
    • Competencies
    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • Hide

      Create a file in Moodle root directory with this code:

      <?php
       
      use core_competency\user_competency_plan;
      require(__DIR__ . '/config.php');
      user_competency_plan::get_competency_by_planid(-1, -1);
      

      Run it and confirm that you see a coding exception error and not a class not found error.

      Show
      Create a file in Moodle root directory with this code: <?php   use core_competency\user_competency_plan; require(__DIR__ . '/config.php'); user_competency_plan::get_competency_by_planid(-1, -1); Run it and confirm that you see a coding exception error and not a class not found error.

      I get this error when I tried to get competency from plan (when competency is not existent)

      PHP Fatal error:  Class 'core_competency\coding_exception' not found in competency/classes/user_competency_plan.php on line 224
      

      The problem is that coding_exception is used but not declared.
      Two solutions are possible:

      • Use the namespace:

        use coding_exception;
        

      • Use the backslash

        new \coding_exception
        

            maherne Michael Aherne
            taboubii Issam Taboubi
            Issam Taboubi Issam Taboubi
            Dan Poltawski Dan Poltawski
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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