Server error log
* ErrorException: [E_NOTICE] Trying to get property of non-object
* src/XF/Pub/Controller/Conversation.php:164
Stack trace
#0 src/XF/Pub/Controller/Conversation.php(164): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/nginx/dom...', 164, Array)
#1 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Conversation->actionView(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF\\Pub\\Controll...', 'View', 'html', Object(XF\Mvc\ParameterBag), 'conversations', Object(XF\Pub\Controller\Conversation), Object(XF\Mvc\Reply\Reroute))
#3 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#4 src/XF/App.php(1844): XF\Mvc\Dispatcher->run()
#5 src/XF.php(328): XF\App->run()
#6 index.php(13): XF::runApp('XF\\Pub\\App')
#7 {main}Request state
array(4) {
["url"] => string(21) "/conversations/23505/"
["referrer"] => string(39) "https://www.site.com/conversations/"
["_GET"] => array(1) {
["q"] => string(21) "/conversations/23505/"
}
["_POST"] => array(0) {
}
}
SELECT *
FROM xf_conversation_master
WHERE conversation_id = 23505
SELECT *
FROM xf_conversation_message
WHERE conversation_id = 23505
SELECT *
FROM xf_conversation_recipient
WHERE conversation_id = 23505
SELECT *
FROM xf_conversation_user
WHERE conversation_id = 23505
deleted
or delete_ignore
.Makes sense, Chris.These conversations haven't been "left" in the conventional way though.
If you leave a conversation the xf_conversation_recipient table has the recipient_state updated to eitherdeleted
ordelete_ignore
.
The recipient state in both cases is still active.
In addition to this, when you leave a conversation, you are removed from the xf_conversation_user table. That record still exists.
The only circumstance where we physically delete the master record (which would remove the messages) would be if there are no active recipients. (everyone has left the conversation). Clearly, however, these conversations do have recipients so we wouldn't have deleted them.
With that in mind, I'm still fairly convinced that something outside of the core software has removed these records.
SELECT DISTINCT(u.conversation_id), u.owner_user_id
FROM xf_conversation_user AS u
LEFT JOIN xf_conversation_master AS m ON
(u.conversation_id = m.conversation_id)
WHERE m.conversation_id IS NULL and u.owner_user_id =2
I won't rule it out. We ran out site from 2007, converted to XF in XF early days, have done restoration, etc. I can't even rule out that I delete those messages myself from DB. I don't remember an can't tell why.Have you ever done any manual database manipulation or a partial data restore?
Yeah basically.So if it's not XF 2 bugs, is it a good idea to remove those records completely?
DELETE FROM xf_conversation_user
WHERE conversation_id IN
(
SELECT * FROM
(
SELECT DISTINCT(u.conversation_id)
FROM xf_conversation_user AS u
LEFT JOIN xf_conversation_master AS m ON
(u.conversation_id = m.conversation_id)
WHERE m.conversation_id IS NULL
) AS na
);
DELETE FROM xf_conversation_recipient
WHERE conversation_id IN
(
SELECT * FROM
(
SELECT DISTINCT(r.conversation_id)
FROM xf_conversation_recipient AS r
LEFT JOIN xf_conversation_master AS m ON
(r.conversation_id = m.conversation_id)
WHERE m.conversation_id IS NULL
) AS na
);
<that number> * <number of recipients>
.We use essential cookies to make this site work, and optional cookies to enhance your experience.