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

SQL error in course_module_competency::count_competencies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.6, 3.6
    • Fix Version/s: 3.5.6, 3.6.4
    • Component/s: Competencies
    • Labels:

      Description

      Debug info: Unknown column 'coursecomp.cmid' in 'where clause'
      SELECT COUNT(comp.id)
                        FROM mdl_competency_modulecomp coursemodulecomp
                        JOIN mdl_competency comp
                          ON coursecomp.competencyid = comp.id
                       WHERE coursecomp.cmid = ? 
      [array (
        0 => '126',
      )]
      Error code: dmlreadexception
      
      

      There is an error in SQL we should replace this code

      $sql = 'SELECT COUNT(comp.id)
                        FROM {' . self::TABLE . '} coursemodulecomp
                        JOIN {' . competency::TABLE . '} comp
                          ON coursecomp.competencyid = comp.id
                       WHERE coursecomp.cmid = ? ';
      

      By this code

      $sql = 'SELECT COUNT(comp.id)
                        FROM {' . self::TABLE . '} coursemodulecomp
                        JOIN {' . competency::TABLE . '} comp
                          ON coursemodulecomp.competencyid = comp.id
                       WHERE coursemodulecomp.cmid = ? ';
      

        Attachments

          Activity

            People

            Assignee:
            damyon Damyon Wiese
            Reporter:
            taboubii Issam Taboubi
            Peer reviewer:
            Luca Bösch
            Integrator:
            Adrian Greeve
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/May/19

                Time Tracking

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