I am creating a forum topic via rule, and it seems to be working with one problem. When you go to the root of the forum (ie. /forum), it shows that there is a new forum topic within the correct term. When I go into the specific term though (ie. /forum/5), none of the ones created by rule appear. I am able to load the forum topic without a problem by going to its URL. I have also found that if I go into one of topics that isn't appearing, click edit, and save (with or without making actual changes) that the forum topic will then appear in the topic list.
I had thought I had found an issue that the rule-created forum topics were getting an erroneous tid=0 in the term_node table. However, when I deleted those rows from the database, the topics still did not reappear. I've been searching but haven't come across what might be the cause for this issue.
Is it a bug or am I missing something else?
Comments
Comment #1
yowzer commentedThis is definitely a bug. I finally found the data inconsistency that was causing it. If you use a rule to create a new forum topic, there is no new row entered into forum with nid, vid (node version id), and tid (term id). This is the solution I decided to use in my custom utility module.
Comment #2
fagoProbably forum module doesn't work correctly on programmatic node saves - not a rules bug though. :/
Comment #3
Cyrandir commentedActually, a change to taxonomy.rules.inc will make this work.
Change this:
into this:
and it works for me. The $node->tid field wasn't getting set correctly. It's supposed to be getting set in forum.module, but apparently not working being passed around. This simple workaround fixes it. I have not tested it to see if it screws up other actions tho, I'm only really worried about getting the forum posts to work.
Comment #4
lastent commentedHow do you assign the created forum topic to a certain forum?