1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not a Bug Alert for thread I'm not watching and haven't posted in

Discussion in 'Resolved Bug Reports' started by CyclingTribe, Jan 22, 2014.

  1. CyclingTribe

    CyclingTribe Well-Known Member

  2. Brogan

    Brogan XenForo Moderator Staff Member

    That was split off from the HYS thread I believe.
  3. CyclingTribe

    CyclingTribe Well-Known Member

    So if you're watching a thread and posts get moved out of it, you auto-watch the newly created thread? Fair enough, but shouldn't the watch status of the new thread reflect this (and allow you to unwatch)?

    Shaun :D
  4. CyclingTribe

    CyclingTribe Well-Known Member

    It's not even in my list of watched threads! :giggle:
  5. Jeremy

    Jeremy Well-Known Member

    Amaury likes this.
  6. CyclingTribe

    CyclingTribe Well-Known Member

    Sure, I get the technicality of what is happening, however it would also be useful to have the "new" thread added to my watch list and the status set to watched.

    The way things are at the moment there's no indication whatsoever of how I got to be alerted about this thread. I only know, for example, that the alert is due to you moving a post from a thread I'm watching because you told me so - otherwise I would be completely in the dark as to how I got it at all.

    Surely that's an important UI/UE issue that could do with fixing?
    Liam W and Brent W like this.
  7. Daniel Hood

    Daniel Hood Well-Known Member

    You aren't watching the new thread though, you won't get any new alerts so it shouldn't update. You may not want to watch the new thread. If anything the argument should be for the alerts to get deleted when the post gets moved.
  8. CyclingTribe

    CyclingTribe Well-Known Member

    So I won't be alerted to any further posts in the new thread?

    Well then the alert should say "Posts from a thread you are watching have been moved to <new thread link/title>" - or something similar; to clarify what the alert is for and avoid any confusion. (y)
    Last edited: Jan 22, 2014
  9. Brogan

    Brogan XenForo Moderator Staff Member

    The alert contents are pulled from the DB, hence why the new thread title is shown.
  10. Daniel Hood

    Daniel Hood Well-Known Member

    Unfortunetely that solution isn't really realistic even though it is optimal. What happens is when you're watching a thread and a new post occurs, a new alert is created with content type: "post", action: "insert", content id: "354345345".

    When it's moved, the alert remains untouched. Your solution is to edit all existing alerts to an action of "move" which could work, or they could just delete them since they're not longer a part of the thread you care about (are watching).

    The alert is very misleading but you won't receive any more for the new thread because you're not watching it. If more posts happen in the other thread and get moved, you'll get alerts for those as well but that's different.
  11. CyclingTribe

    CyclingTribe Well-Known Member

    Sure, I just think with XF 1.3's new ability to move posts (which my mods are going to love and probably use on a daily basis) - it would be better for the alert to be more informative, i.e. you're getting this because you watched the original thread it came from. If that's not possible, fair enough - it won't be too hard to educate my userbase. (y)
  12. Mike

    Mike XenForo Developer Staff Member

    FWIW, this isn't something new in 1.3 -- you could move posts in 1.0 and the same thing would happen with alerts.
    Ryan_, Amaury and Daniel Hood like this.
  13. Daniel Hood

    Daniel Hood Well-Known Member

    I think two valid solutions would be this:

    In XenForo_DataWriter_DiscussionMessage_Post::_messagePostSave()
    if ($this->isUpdate() && $this->isChanged('thread_id'))
                        $db = $this->_db;
                        $db->update('xf_user_alert', array(
                                'action' => 'move'
                        ),  "content_type = 'post' and content_id = " . $db->quote($this->getExisting('post_id')));
    Or change line 76 of the same file from this:

    if ($this->isUpdate() && $this->get('message_state') == 'deleted' && $this->getExisting('message_state') == 'visible')
    to this:

    if ($this->isUpdate() && (($this->get('message_state') == 'deleted' && $this->getExisting('message_state') == 'visible') || $this->isChanged('thread_id')))
    The first solution requires a new template for the alert method. The second one just removes the alerts.
    CyclingTribe likes this.

Share This Page