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

chat/lib.php chat_print_recent_activity() has an empty if block

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 2.6.4
    • Fix Version/s: STABLE backlog
    • Component/s: Chat
    • Labels:
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      if (!$users = $DB->get_records_sql("SELECT $userfields
                                                        FROM {course_modules} cm
                                                        JOIN {chat} ch        ON ch.id = cm.instance
                                                        JOIN {chat_users} chu ON chu.chatid = ch.id
                                                        JOIN {user} u         ON u.id = chu.userid
                                                       WHERE cm.id = :cmid $timeout $groupselect
                                                    GROUP BY $userfields", $params)) {
                  }
      

      I suspect the if can just be removed. The code below it has a guard around to prevent errors. Alternatively maybe want to leave the if in but put a debugging call in there. Either way we shouldn't be doing what we are doing now.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: