Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3622

MSSQL database read error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Block: AJAX Marking
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      Hi Matt
      This new release breaks the block completely for me - it doesn't even appear and I get this error:

      Debug info: SQLState: 42000<br>
      Error Code: 156<br>
      Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'WHERE'.<br>

      SELECT DISTINCT(role.id)
      FROM mdl_role role
      INNER JOIN mdl_role_capabilities rc
      WHERE rc.contextid = 1
      AND rc.capability IN (N'mod/assignment:grade',N'mod/forum:viewhiddentimedposts',N'mod/quiz:grade',N'mod/workshop:editdimensions')

      [array (
      0 => 'mod/assignment:grade',
      1 => 'mod/forum:viewhiddentimedposts',
      2 => 'mod/quiz:grade',
      3 => 'mod/workshop:editdimensions',
      )]
      Stack trace:
      line 394 of \lib\dml\moodle_database.php: dml_read_exception thrown
      line 252 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
      line 368 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
      line 773 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
      line 807 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
      line 61 of \blocks\ajax_marking\lib.php: call to sqlsrv_native_moodle_database->get_records_sql()
      line 137 of \blocks\ajax_marking\lib.php: call to block_ajax_marking_teacherrole_sql()
      line 72 of \blocks\ajax_marking\block_ajax_marking.php: call to block_ajax_marking_get_my_teacher_courses()
      line 280 of \blocks\moodleblock.class.php: call to block_ajax_marking->get_content()
      line 232 of \blocks\moodleblock.class.php: call to block_base->formatted_contents()
      line 926 of \lib\blocklib.php: call to block_base->get_content_for_output()
      line 978 of \lib\blocklib.php: call to block_manager->create_block_contents()
      line 311 of \lib\blocklib.php: call to block_manager->ensure_content_created()
      line 214 of \theme\decaf\renderers.php: call to block_manager->get_content_for_region()
      line 148 of \my\index.php: call to theme_decaf_core_renderer->blocks_for_region()

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: