Closed (won't fix)
Project:
Discuss This!
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
23 Jun 2008 at 17:32 UTC
Updated:
29 Nov 2013 at 11:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
toemaz commentedSuggestion: don't the text in the node->body, but simply use hook_view or nodeapi to add a field to the $content array with the text inside. That way the text can be localized as well.
Comment #2
spidermanI'm not sure what you mean here- I think you missed a verb in the phrase "don't the text in the node->body", but I'm also not convinced you understand what i'm talking about (no disrespect, I think we might just have a miscommunication).
At present, when the user clicks the Discuss This! link for the first time, it triggers the discussthis_new function, which in turn calls _discussthis_new_topic. This function uses drupal_execute to create a new forum node, and fills in the title/body of this node on behalf of the author the admin selected. How would hook_view or nodeapi help me here?
Thanks,
Derek
Comment #3
spidermanAs of commit #123181 I've added token.module support and added admin-configurable custom templates for the title and body of the auto-created forum topics.
Comment #4
toemaz commentedMy proposal: leave the body empty ($values['body'] = '') and use hook_nodeapi instead in this module to add an extra $content['discuss_this'] to the $node when $op == 'view' and when $node->type == 'forum'.
Advantages:
Comment #5
spidermanah, ok- i think i see what you mean now.. will try to incorporate this today, but i would be most happy if you wanted to roll a patch to this effect :)
Comment #6
toemaz commentedWell, to be honest, I wont be using the module because it doesn't fit my needs. I was just having fun reviewing it ;-)
Comment #7
spidermanHey, no worries- I appreciate the feedback nonetheless :)
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #9
ksenzeeI'm attaching a patch that implements #4, in case you're still interested in the idea. It seemed like a good way to make the default easy to override, and the point about avoiding the search index is well taken.
Comment #10
ksenzeeUm, duh. It would be nice if the patch didn't mess with the node body on forum topics that discussthis didn't create. New patch attached.
Comment #11
spiderman@ksenzee: appreciate the patch, but on applying it, I've found it seems to create more bugs :(
First, the $values['body'] = '' produced an error complaining about the body field being required. When I put in a instead, it ended up adding extra whitespace to the display of the forum topic itself.
Second, I found I was getting an error about duplicate term_node entries being inserted, but didn't track down where this was coming from.
All of this highlights for me the desperate need to re-work the node creation mechanism, as it is clearly very fragile and inelegant for the moment. I'm going to give this some love in the next few days, but if you have any ideas, please feel welcome to throw them out!
Thanks!
Comment #12
spidermanCorrection: the duplicate term_node insert warning was due to another problem, which is now fixed. Unfortunately, this problem also highlights the fragility of the node creation process, which is now at the top of my hitlist ;)
Comment #13
dom. commentedModule maintainer has changed. I'm closing this issue after years of inactivity, please open a new issue if needed.