MyBB Community Forums

Full Version: [F] Missing images after merging posts [R] [C-Michael83]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
One of my mods merged some posts into one, the merged post lost it's images. The attachements were showing as added into the page and all I see is text. So I deleted the attachments in the post and the images still wont show in the post in the attachments box. The images still show as attachments are their when in full edit, they just aren't showing. Couldnlt find anything in the bugs section that matched this. I could be wrong however because all I looked at are the titles since there are 99 bugs.

Using the lastest version 1.4.4
In the first look you can see that the problem is with $thread['attachmentcount'] (showthread.php line 765), sometimes it doesn't updated to the right value.

Recount & rebuild thread counters solved the problem, as well as adding a new attachment to the thread.

Update:
I've tested this bug only with merges of 2 posts and the problem occur only when the first post has attachments and the second post has NO attachments, then I've take a look over 'inc\class_moderation.php' function merge_posts():
line 606 Wrote:
$query2 = $db->simple_select("attachments", "COUNT(aid) as count", "pid IN({$pidin}) AND pid != '{$masterpid}' AND visible='1'");
$pidin is a comma separated list of all post's ids to be merged, $masterpid is the post id of the first post (with 'ORDER BY p.dateline ASC')
The result is the new $thread['attachmentcount'] :
$attachment_count = $db->fetch_field($query2, "count");
$db->update_query("threads", array("attachmentcount" => $attachment_count), "tid = '{$mastertid}'");

So it's actually sets the $thread['attachmentcount'] to the count of all attachment from all of the posts that need to be merged except the first one, why does the query built like this?
I remember something like this already being reported and fixed for the SVN
The line you remember is line 585 (trunk), with the users table
dvb, great job, confirmed the re-count and re-build DID put the images back. However keep in mind, this took me over 45 minutes to do all my processes. I do not have a small forum. So a fix would be much appreciated my friends. Thank you again dvb as we use photo viewing in our <....> Big Grin Over 7000 kit photos now Big Grin

Thanks gentlemen
Of course we'll write a fix, we're working on it.

And please play nice Wink you're on public view
Thanks again dvb
(2009-03-06, 03:00 AM)dvb Wrote: [ -> ]Of course we'll write a fix, we're working on it.

And please play nice Wink you're on public view

Ermmm I was playing nice... drum Porn is not real porn.. Rolleyes It's just pictures of drumsets... that's it... Nothing more... The people treat drumset pics as a pleasure to view, classic ones, new ones etc... We're a musical forum, not a porn site.. O.o It's just a phrase.

There's posts here with porn mentioned in them in the subject with the same no meaning my post has btw.. And btw- Your welcome for me taking the time out of my schedule to report your bugs Smile

regards
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group