On one of my sites which has been around since 4.6, and now runs 5.1 I was having an issue where all my forum posts ended up with “Topic has moved” messages, which pointed to nowhere (term/0). This seems to have been caused by us originally allowing multiple selections of forum topics. Of course the newest versions of Forum do no allow this, and prevent you from selecting this option. However it was still enabled on this site due to the migration path. So, a few SQL queries to fix the issue. First we need to fix the broken posts

UPDATE `forum` f INNER JOIN term_node t ON  (t.nid=f.nid)  
SET f.tid=t.tid  
WHERE f.tid=0  

Now we need to fix the forums topics

UPDATE `vocabulary` SET `multiple` = '0' WHERE `module`='forum';  

Powered by ScribeFire.