Fixed  Issue with viewing soft deleted messages

Deebs

Well-known member
If I soft delete a message and then click "Show" it takes forever and an age for it to be displayed. I get the little activity display in the top right corner then about 15-20 seconds it actually shows the message.

One of my mods was also performing some testing with soft deleted messages and said the following:

When I try to view a deleted post, the sever ends up timing out. Or that time, it took ages, came up with an "unspecified error" pop-over (like the NEW THREAD pop-over) then reappeared.

If I undelete it though, it comes back quickly enough.
 
Can you consistently reproduce this on all threads, or just one in particular? Have you tried different browsers?
 
Ok,

Tried FireFox 3.6.8 and IE 8 across threads with 3 posts, 100 posts and greater than 500 posts. The results are consistent. It takes forever to "Show" the message, deleting the message is instant, undeleting the message is also instant.
 
I tried this on a 5.5m post db and :eek: yes, you're right!

Thankfully we've found the problem and it was a relatively easy fix.
 
If anyone else with a very large number of posts is affected by this, you can apply the following fix:

XenForo_ControllerPublic_Thread, line 292, change this:
PHP:
$postIds = preg_replace('/^post-(\d+)$/', '\1', $postIds);
to this
PHP:
$postIds = array_map('intval', preg_replace('/^post-(\d+)$/', '\1', $postIds));
 
Top Bottom