I've seen quite a lot of people wanting polls and other node types to appear in forums. This currently isn't possible due to the close relationship between forum.module and the forum node type. Most generic forum software supports polls (if not cck-enabled nodes!), and people have brought it up in the past as a reason not to want to use the core forums.

So this issue is to work on making forum.module work with other node types.
I originally started thinking seriously about this due to: http://drupal.org/node/145353 and reckon that stuff's got a much higher priority, but as you can see my initial patch shouldn't conflict at all with that issue as it stands at the moment.

There's a couple of things that need to be done, neither are very major, but I proabably don't have the chops to take them all the way, so I'm hoping someone else will be able to give me a hand assuming there's support for the idea. I may also have missed something:

1. ensure that all queries in forum.module aren't dependent on AND n.type = 'forum' - this is done in the current patch apart from one query in function forum_block. I think that can be done with a join to forum so the nids are selected from there, and the information drawn from elsewhere. I'm hoping for guidance on whether this will affect performance at all (there should be no performance hit, or a very slight gain due to smaller result set and reduced logic, for all other queries).

2. It's currently perfectly possible to enable your forum vocabulary to other node types, and have them appear in the taxonomy/term listings for that vocabulary. But they'll never appear in your forum because the tid/nid relationship isn't written to the forum table. Therefore, there'd need to be a way to enable that per node type.

This should be fairly trivial to do I would think, but where it goes in the UI (forum admin/content type settings etc. etc.) is probably worthy of discussion. I'm not familiar with actions at all, but running that extra insert if a node type is enabled as forum could just be an action couldn't it?

Either way, adding forum nodes to the forum itself, is currently done in forum update, I'm guessing that could be moved to an action, then set as default for the forum node type and optional for any other.

Attached patch is the same as the last patch on forum performance improvements by david strauss, but it's a jumping off point for this issue.

Next step is to change that last query in forum_block, and work on part 2. Help/advice on both of those would be much appreciated.

CommentFileSizeAuthor
i145353_1_0.patch9.28 KBcatch

Comments

catch’s picture

Title: allow other node types to appear in forums » allow other node types to appear in forums - part 1.

Quick update.

I think the query tidying can go in as is once forum_block is fixed. It doesn't affect any apis, has negligible or positive performance impact, and only one minor db change adding an index.

Getting other node types in should go in Part 2. Will open initial issue for that tomorrow.

catch’s picture

Status: Active » Closed (duplicate)

Marking as duplicate

http://drupal.org/node/149327

catch’s picture

or even the right issue: http://drupal.org/node/20295