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

Unread messages displays forum post instead of unread message

XMLWordPrintable

    • MOODLE_20_STABLE, MOODLE_29_STABLE
    • Easy

      I rely heavily on email. I am subscribed to many of the forums. I have my messaging setup to send email copies of forum posts (not popup messages). What I have occasionally noticed is that when a user sends me a message, I get a copy of the email message; however, when I login and go to read the message at http://moodle.org/message/index.php I see that I have one message from the user. When I click on that link I am taken to a page like: http://moodle.org/message/index.php?usergroup=unread&id=1280975 which displays a forum post from that user and not the message they sent me. I looked into the database to see what read messages I had and I am seeing records from the forum posts. There seems to be an issue whereby forum posts are being added as messages to me from the user.

      In the database, I did a

      SELECT *
      FROM message_read
      WHERE useridfrom =1280975
      AND useridto =51473
      ORDER BY `message_read`.`id` ASC

      and noticed that the messages from the forums had notification values of 1 while the actual user to user messages had a value of 0. Looking at /message/lib.php's message_count_unread_messages I am wondering if we should check and see if the user's messaging preference includes forum posts (or other types). In my case, the behavior I was expecting since I did not want popup notifications of forum posts is that I would only see the user to user messages. I'm not exactly sure what the idea check would be but am thinking along the lines that given my current state of preferences (see message_settings.png) perhaps adding in to the where clause 'AND notification=0' would be helpful.

      I'm a little confused by how notification is being used. In the user to user messages I have received an email. Based on the settings, I would expect a positive indication of popup notification to be stored as a 1 in the database but here it seems to be the opposite.

      Is it possible that in the forums, the personal setting is not being properly recorded? And then in messages it is not being set either?

      Reproducing has been a challenge as I do not always observe the behavior but Helen has also noticed this from time to time. I'm filing it here initially but you may want to move it over to MDL once it is clear what exactly is happening. I'm attaching message_forums.png which shows the result of the sql query, messages_post.png showing the unexpected message about a forum post rather than the message received via email which is message_read's id=4890817.

      In any case, let me (or Helen) know if you have questions or how I might be of help in tracking this down.

      Peace - Anthony

        1. mdl_message.png
          mdl_message.png
          125 kB
        2. message_forums.png
          message_forums.png
          187 kB
        3. message_settings.png
          message_settings.png
          195 kB
        4. messages_post.png
          messages_post.png
          156 kB

            Unassigned Unassigned
            aborrow Anthony Borrow
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.