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

Journal Activity in moodle 2.1 gives an error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.1.2
    • Fix Version/s: None
    • Component/s: Module: Journal
    • Labels:
    • Environment:
      Moodle 2.1.2+, php 5.3.8, Windows 2008 R2, IIS 7.5 fastcgi, MS-SQL 2008
    • Database:
      Microsoft SQL
    • Workaround:
      Hide

      None

      Edited the file mod/journal/lib.php changed ORDER BY j.modified DESC to ORDER BY u.id DESC

      I could then add a journal entry.

      Show
      None Edited the file mod/journal/lib.php changed ORDER BY j.modified DESC to ORDER BY u.id DESC I could then add a journal entry.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      After creating a journal activity I then click on the link to add journal entry and get the message 'error reading from database' and cannot go any further.

      Debug info: ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
      SELECT DISTINCT u.id FROM mdl_journal_entries j
      JOIN mdl_user u ON u.id = j.userid 
      WHERE j.journal = '232' 
      ORDER BY j.modified DESC
      [array (
      )]
      Stack trace:
      line 394 of \lib\dml\moodle_database.php: dml_read_exception thrown
      line 255 of \lib\dml\mssql_native_moodle_database.php: call to moodle_database->query_end()
      line 711 of \lib\dml\mssql_native_moodle_database.php: call to mssql_native_moodle_database->query_end()
      line 740 of \lib\dml\mssql_native_moodle_database.php: call to mssql_native_moodle_database->get_recordset_sql()
      line 628 of \mod\journal\lib.php: call to mssql_native_moodle_database->get_records_sql()
      line 53 of \mod\journal\view.php: call to journal_count_entries()

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: