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

Error: coding_exception not found in user_competency_plan

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1, 3.1.2
    • Fix Version/s: 3.1.3
    • Component/s: Competencies
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:

      Description

      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
        

        Attachments

          Activity

            People

            • Assignee:
              maherne Michael Aherne
              Reporter:
              taboubii Issam Taboubi
              Peer reviewer:
              Issam Taboubi
              Integrator:
              Dan Poltawski
              Tester:
              Jun Pataleta
              Participants:
              Component watchers:
              Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Nov/16