Moodle
  1. Moodle
  2. MDL-20303

Contacts are'nt showed in private messages window

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.5
    • Fix Version/s: None
    • Component/s: Messages
    • Labels:
      None
    • Environment:
      Solaris + Oracle
    • Rank:
      12956

      Description

      Contacts list isn't showed in messages window. When debug is activated the following error appears:

      ORA-00911: invalid character

      SELECT u.id, u.firstname, u.lastname, u.picture, u.imagealt, u.lastaccess, count(m.id) as messagecount FROM mlmessage_contacts mc JOIN mluser u ON u.id = mc.contactid LEFT OUTER JOIN mlmessage m ON m.useridfrom = mc.contactid AND m.useridto = 85 WHERE mc.userid = 85 AND mc.blocked = 0 GROUP BY u.id, u.firstname, u.lastname, u.picture, u.imagealt, u.lastaccess ORDER BY u.firstname ASC;

      • line 686 of lib/dmllib.php: call to debugging()
      • line 56 of message/lib.php: call to get_recordset_sql()
      • line 87 of message/index.php: call to message_print_contacts()

      ORA-00911: invalid character

      SELECT u.id, u.firstname, u.lastname, u.picture, u.imagealt, u.lastaccess, count(m.id) as messagecount FROM mlmessage m JOIN mluser u ON u.id = m.useridfrom LEFT OUTER JOIN mlmessage_contacts mc ON mc.contactid = m.useridfrom AND mc.userid = m.useridto WHERE mc.id IS NULL AND m.useridto = 85 GROUP BY u.id, u.firstname, u.lastname, u.picture, u.imagealt, u.lastaccess ORDER BY u.firstname ASC;

      • line 686 of lib/dmllib.php: call to debugging()
      • line 88 of message/lib.php: call to get_recordset_sql()
      • line 87 of message/index.php: call to message_print_contacts()

      To solve it it's necessary to delete the semicolon at the end of the following SQL sentences in the message/lib.php file:

      message/lib.php (line 52)
      $contactsql = "SELECT u.id, u.firstname, u.lastname, u.picture,
      u.imagealt, u.lastaccess, count(m.id) as messagecount
      FROM {$CFG->prefix}message_contacts mc
      JOIN {$CFG->prefix}user u
      ON u.id = mc.contactid
      LEFT OUTER JOIN {$CFG->prefix}message m
      ON m.useridfrom = mc.contactid
      AND m.useridto = {$USER->id}
      WHERE mc.userid = {$USER->id}
      AND mc.blocked = 0
      GROUP BY u.id, u.firstname, u.lastname, u.picture,
      u.imagealt, u.lastaccess
      ORDER BY u.firstname ASC";

      message/lib.php (line 83)
      $strangersql = "SELECT u.id, u.firstname, u.lastname, u.picture,
      u.imagealt, u.lastaccess, count(m.id) as messagecount
      FROM {$CFG->prefix}message m
      JOIN {$CFG->prefix}user u
      ON u.id = m.useridfrom
      LEFT OUTER JOIN {$CFG->prefix}message_contacts mc
      ON mc.contactid = m.useridfrom AND
      mc.userid = m.useridto
      WHERE mc.id IS NULL AND m.useridto = {$USER->id}
      GROUP BY u.id, u.firstname, u.lastname, u.picture,
      u.imagealt, u.lastaccess
      ORDER BY u.firstname ASC";

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          thanks for the great bug report - this is now fixed in 1.9Stable and HEAD

          Show
          Dan Marsden added a comment - thanks for the great bug report - this is now fixed in 1.9Stable and HEAD

            People

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

              Dates

              • Created:
                Updated:
                Resolved: