MyBB Community Forums

Full Version: what happens if posthash in posts table is empty?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
what happens if posthash in posts table is empty?
is there any drawback or functionality issue there ?
See: http://community.mybb.com/thread-33838-p...#pid227016

I haven't looked into it much, but it seems you'll have issues with uploading attachments if the posthash doesn't exist.
you might also have issues with quick reply
I'm having this issue, I was using advanced quick reply plugin (which signature stopped working) and disabled it but I doubt that has anything to do with attachments.
Anyway the posthash was blank for 7 attachments and in some cases these 7 attachments will move themselves all to a different post id and thread id....
I fixed the pid and tid in phpMyAdmin but how do I generate posthash for these 7 attachments so this doesn't happen again (the attachments moving posts).
My original post with this problem:
http://community.mybb.com/thread-131741.html

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!