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

Not a bug Alert Bug?

Daniel Hood

Well-known member
These reports are so common...
Cause it seems like a bug from a user stand point. I posted what I feel is a good solution. I may package it as an add on if it's not resolved in 1.3.

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.