Everything seems fine - but I have comments under the node view and on the separate tab - is this the intended default behavior or a bug? Apologies for asking - but I haven't used this module before.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | remove-comments-from-node-1216968-12.patch | 473 bytes | geerlingguy |
Comments
Comment #1
lodey commentedTo get around this I created a node template for the content type I wanted the Discussion functionality - In my case Books.
Simply don't render the comments - it still works in the tabs.
Might be a nice setting to have in the Content type config.
Comment #2
jacobson commentedDitto. I have this same problem and have had to do the same as Lodey suggested.
Comment #3
jarodms commentedbyproduct of #1215894. please retest this with the latest DEV version.
Comment #4
jarodms commentedComment #6
JSCSJSCS commentedI just installed talk dev (7.x-1.0-beta3+5-dev) version on D7.12 and I see the comments on both the node and the talk tab on all articles except one. Only one article is working as expected and I do not see any difference between that one and any other except that the comments were set to hidden by the module.
If I edit that one article's comment settings to "OPEN", then it stops working correctly (comments on article and in comments tab).
If I disable and re-enable the module, that one article has its comments settings setback to "HIDDEN" and will work again. This one article is not the first or last article node written. It is beyond me why the talk module decided to work on only this one article.
I tried creating a new article while the module was enabled and it did not work either.
Apologize in advance if it was poor form to change status to active, but I think it went to fixed for lack of input.
Comment #7
Anonymous (not verified) commentedI am seeing this also, in the -dev version of 7 May 2012.
Comment #8
Anonymous (not verified) commentedOK, the problem here is with talk_node_load.
It clobbers the comments conditional on:
talk_activated($node->type) && arg(0) == 'node' && !arg(2)I don't know what this is trying to do. I'm using path aliases, and arg() sees those, not "node", so the code above definitely can't work.
Just changing it to TRUE works for me. Presumably there's some case in which that is the wrong thing?
Comment #9
Anonymous (not verified) commentedAnother thing. According to the documentation for hook_node_load:
I'm not sure, is there a caching issue here because we're "replacing information" by bashing the $node object ?
Comment #10
Anonymous (not verified) commentedAnswer: yes, there is a caching problem!
This sets the node to have $node->comment = 0. (That should actually be COMMENT_NODE_HIDDEN , not the literal 0.)
The problem is that this is cached and persists. So if you go to the talk page and post a comment, after submitting it, you get the error message "This discussion is closed: you can't post new comments.", generated by comment_reply in comment.pages.inc when $node->comment != COMMENT_NODE_OPEN (which is what it finds in the cache).
As far as I can tell, comment posting with Talk now only works when the arg(0) == 'node' && !arg(2) condition fails. (And that condition is wrong.)
[I have checked, and this code comes from the D6 version. But apparently there are core differences between D6 and D7 so it no longer works.]
It would seem that some better way of hiding the comments is needed...
Comment #11
Anonymous (not verified) commentedSo, the problem here is that talk_node_load() is called during the bootstrap, before Drupal has translated the path alias. Specifically, during drupal_bootstrap, it calls drupal_get_normal_path in order to translate aliases, during which it calls entity_load, which eventually calls talk_node_load(). So in that function, arg() still sees the alias, not /node/NID.
So, we need to clobber the comments later than hook_node_load. (And it would be better to do it in a cleaner way that doesn't muck up caching.)
It would seem that talk_node_view() is the right place. I removed talk_node_load, and added the following to talk_node_view():
This seems to work. If I run into further problems, I'll follow up here.
Comment #12
geerlingguy commentedAnd here's a patch (attached).
Comment #13
bago commented#12 worked for me.
Comment #14
geerlingguy commentedComment #15
geerlingguy commentedLooks like this patch was committed on Nov. 7 and is present in 1.0: http://drupalcode.org/project/talk.git/commit/bd4be67