When anyone (anon/admin) creates a new forum topic, the topic is listed as "This topic has been moved". E.g. forum/1 lists currently 2 "moved" topics, each points to forum/0

(thanks to Morbus for confirming :))

CommentFileSizeAuthor
#12 forum.patch.txt1.58 KBcrunchywelch

Comments

purluno’s picture

I fixed this problem in my test site to change code like this:

--- forum.module.orig   2005-12-09 21:55:15.000000000 +0900
+++ forum.module        2005-12-09 22:20:24.000000000 +0900
@@ -609,7 +609,8 @@
  * Implementation of hook_insert().
  */
 function forum_insert($node) {
-  db_query('INSERT INTO {forum} (nid, vid, tid) VALUES (%d, %d, %d)', $node->nid, $node->vid, $node->tid);
+  $tid = $node->taxonomy[_forum_get_vid()];
+  db_query('INSERT INTO {forum} (nid, vid, tid) VALUES (%d, %d, %d)', $node->nid, $node->vid, $tid);
 }

 /**

is it right?

dries’s picture

The suggested solution is incorrect. You use the 'vid' (vocabulary ID) which is not to be confused with a 'tid' (term ID).

Wesley Tanaka’s picture

This appears to be one of the probably many symptoms, experienced by modules that defined a node type, of a nodeapi search and replace that wasn't quite finished properly.

See http://drupal.org/node/40587 for a patch

dries’s picture

Status: Active » Fixed

Committed http://drupal.org/node/40587. Thanks.

jmcclare’s picture

Status: Fixed » Active

I am still seeing this issue. Forum topics are not immediately listed as "moved", but if a user edits a forum post with "create new revision" checked, the post is once again moved. The problem does not occur if the "create new revision" option is not active.

jmcclare’s picture

Status: Active » Fixed

Scratch that. I am no longer seeing that behavior. I think I grabbed a new version from CVS since then, so the change must have been there.

Anonymous’s picture

Status: Fixed » Closed (fixed)
pegmonkey’s picture

Version: » 4.7.0
Status: Closed (fixed) » Active

I'm still seeing this as a problem. 4.7.0 Latest CVS build Revision 1.328 Thu Apr 13 08:25:27 2006 UTC. Any forum topic created is moved to forum/0 I've disabled all but a very few core modules necessary to test the situation.

pegmonkey’s picture

Priority: Critical » Normal

I'm no longer seeing it either. I created a new site where forums worked. I went back to the original site to compare the two. I ended up creating a new upgrade site to replace the site with non-functioning forums. I swapped the directories and found forums to be working immediatly after making the swap. Then, I did a diff between the old site and the new site. NO DIFFERENCE at all. Permissions are all in place etc. I'm still scratching my head. So, I swapped in the old directory again just for grins. It works too. Could something be latent.. cron job.. I had cron set to run every minute. Cache of some kind?

chx’s picture

Status: Active » Closed (fixed)
crunchywelch’s picture

Status: Closed (fixed) » Active

Im seeing this behaviour on a fresh checkout of 4.7. forum.module 1.328.2.1. Not sure whats causing it yet.

crunchywelch’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB

We dont get the tid when loading the forum topics, just change the table reference on it in the query to fix.

killes@www.drop.org’s picture

I am not sure this fix is correct. f.tid is the tid from the forum table.

drumm’s picture

Status: Needs review » Closed (won't fix)

Please reopen with specific steps to reproduce (because I can't).

danroth’s picture

I'm having the same problem on a 4.7.2 site.

disterics’s picture

Same here. It was happening in 4.7.2, upgraded to 4.7.3 problem still exists.
It looks like the forum tid is being set to zero. I know this is not happening on a pure 4.7.2 site (i.e no upgrade). Will investigate further and post any findings.

danroth’s picture

I've also upgraded to 4.7.3 and the problem persists.

danroth’s picture

So, what does status "won't fix" mean?
Does it mean the solution given doesn't really fix the bug?
Or does it mean the development team has no intention of addressing the bug?

heine’s picture

From #14

Please reopen with specific steps to reproduce (because I can't).

In order to adress the bug, more information is needed.

fallacious’s picture

I had the same problem after upgrading from 4.6.x to 4.7.0. The root cause was trash in the database, but silly me hasn't kept notes. I should know better by now.

The sympton was easy to fix - track down the moved posts in the database, manually validate the fields, and if necessary patch things up (like the vid or whatever). When I say easy, I mean it's technically straightforward, but involves a fair amount of cussing out loud.

Now that I think about it, the posts were displayed as moved because they were either assigned to the (non-existent?) term 0 of the forum vocabulary or the forum vocabulary was somehow invalid (set to 0?). If I had to troubleshoot this again, I'd have a really, really close look at the forum table first and generally make sure that Drupal uses the vocobulary it's supposed to.

If I can dig up a pre-4.7 database snapshot of mine, I could be persuaded to try to replicate the problem and refresh my memory. However, the solution should be very obvious once you start to eyeball the database.

danroth’s picture

AHA!

I believe I may have found an explanation of the problem here:
http://drupal.org/node/54493

It seems the solution is to not allow multiple categories for forum posts!
It also seems that 4.7's version has been changed, so when you edit forum vocabulary, it includes this line: "Some of the normal vocabulary options have been removed."

However, this option was set before my upgrade from 4.6.x
I'm guessing that if I can find out in the database where to change this back, the problem should be solved.

danroth’s picture

Title: All new forum topics are listed as "moved" » The solution!

Running this query on your (mySQL) database should solve the problem:

update vocabulary set multiple=0 where name="Forums"

(that's a zero, NOT the letter 'o')

asimmonds’s picture

Title: The solution! » All new forum topics are listed as "moved"

Please don't change the issue title to something that is not relevant

danroth’s picture

sorry... new to this section of the website...
didn't catch the "Note: modifying this value will change the title of the entire issue, not your follow-up comment."

ChrisKennedy’s picture

Status: Closed (won't fix) » Active

I had this happen to my forums this past week and danroth is correct that it can be solved by setting the forum's multiple attribute to 0. His SQL works if the forum vocabulary is named "Forums", but a more general solution (with appropriate prefix) is:

UPDATE vocabulary set multiple=0 WHERE module="forum";

You can test the problem by setting multiple=1 via SQL and it is a bug in both HEAD and 4.7. I'm not sure how it is set to 1 originally as forum_form_alter() has a hack to disable the multiple attribute (and others) from being displayed in the vocabulary edit form for the designated forum vocabulary.

So additional sanity checks need to be made to enforce the multiple=0 requirement, or support for multiple terms should be added.

There are a large number of vocabulary/term/taxonomy-related bugs in the forum issue queue, so the long-run fix will likely require refactoring the way forum handles its vocabulary.

jjma’s picture

Version: 4.7.0 » 4.7.3

I tried this on our database and we still have the issue of "This topic has been moved". I also tried applying the patch mentioned in this thread http://drupal.org/node/40587 but was unsuccessful.

Anymore suggestions? Running drupal 4.73 on mysql version 4.1.20/php4.

Jon

sl27257’s picture

I have recently upgraded from 4.6 to 4.7(.5). When I started adding new topics I still had this bug showing up. After reading through all postings here I have managed to get it working again. The final problem which does not seem to be handled correctly is when you are doing an upgrade.

  1. The current forum.module for 4.7.5 correctly removes all the possiblities to put the forums into "allow multiple terms".
  2. For old forums (from a previous version i.e 4.6) it is not possible to switch an old forum group into the correct mode (no cross postings)
  3. This should be taken care of by the upgrade function.
  4. If not all how upgrades and have allowed crosspostings in the previous versions will continue to run into problem.

/Thomas

mr.andrey’s picture

Version: 4.7.3 » 5.2

I've tried all the solutions above, and I'm still experiencing this problem.

It seems that $node->taxonomy isn't getting picked up in the forum_submit function. In the following function, the if ($node->taxonomy) doesn't match.

function forum_submit(&$node) {
  // Make sure all fields are set properly:
  $node->icon = !empty($node->icon) ? $node->icon : '';

  if ($node->taxonomy) {
    // Get the forum terms from the (cached) tree
    $tree = taxonomy_get_tree(_forum_get_vid());

If I manually set $node->tid = 41 above the if ($node->taxonomy) statement, the topic appears in the correct forum without "this topic has been moved" thing.

Seems like $node->taxonomy isn't getting picked up somewhere.. maybe it's outside of this module?

Any ideas?

Thanks,
Andrey.

P.S. I'm using Category module, so this may have something to do with it.

Wesley Tanaka’s picture

Version: 5.2 » 4.7.3
Status: Active » Closed (fixed)

Please open a new issue. This one was definitely fixed in 4.7.x.