MyBB Community Forums

Full Version: [SOLVED] Attachments are moving POSTS!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm not sure what prefix this goes under but this is the second time in the last 3 days this issue has happened to me.
Attachments are moving by themselves from one particular post they originated from to another thread and post ENTIRELY!

I'm very concerned about this...
I'll answer any questions about my setup, server, etc, and give access if needed to help me solve this. please.

I've discovered that the post hashes have gone missing for the moving attachments! Not to mention the PID & TID is all wrong.
[attachment=28142]
I have no idea how that would happen...
I can tell you it's only been happening with attachments from the same originating PID 4483.

I've also found in the originating TID that the attachment count could be wrong, it has 11 in it's row entry. (I changed it to 7)
There's only 7 attachments on the thread and they are all from the original post which are the all of the attachments that moved their PID,TID, and their post hash disappeared.

I've been able to move all the attachments back to their original post via phpMyAdmin but
how do I regenerate the posthash for the attachments?

Related posts:
http://community.mybb.com/thread-114524.html
http://community.mybb.com/thread-77971.html
Now the OP in thread 77971 said this:
(2010-09-09, 12:00 AM)Tyler E. Wrote: [ -> ]How do you create a posthash value in Mybb?
Need this last value to complete my script.
Fixed. It's:
mt_srand ((double) microtime() * 1000000);
$posthash = md5($mybb->user['uid'].mt_rand());

So is that correct and if so how do I execute it for those 7 attachments to get their posthashes back?







frostschutz provided me a fix for the posthash issue on this post:
http://community.mybb.com/thread-77971-p...#pid954198
(2012-12-28, 10:04 PM)frostschutz Wrote: [ -> ]This should reset ALL posthashes to a random md5 hash for each post and attachment. In phpMyAdmin, execute all three lines in one go.

SET @salt=CONCAT(RAND(),RAND(),RAND(),RAND());
UPDATE mybb_posts SET posthash=MD5(CONCAT(@salt, '-', pid, '-', uid, '-', @salt));
UPDATE mybb_attachments SET posthash=MD5(CONCAT(@salt, '-', pid, '-', uid, '-', @salt));

It shouldn't cause any problems as long as no one is creating/editing a post with attachments at the time you run this.

It works. Thank you Frostschuz!
Still curious how this happened in the first place though lol
I'm having yhe same problem with new version ( 1.6.12 )...Attachments are moving by themselves from one particular post they originated from to another thread and post ENTIRELY!

I already aply your recommendation....I hope that this fix my issue. Sad