Hi all,

I can't seem to lock threads with the new 2.0-alpha3 with nodecomments. Saving with Comment Settings -> Disable says that it has been saved, but nothing changes.

CommentFileSizeAuthor
#6 nodecomment_848598.patch663 bytescrea

Comments

michelle’s picture

Project: Advanced Forum » Node Comments
Version: 6.x-2.0-alpha3 » 6.x-2.x-dev

Confirmed but this isn't an Advanced Forum issue. Moving to the Nodecomments queue.

Michelle

crea’s picture

Priority: Normal » Critical

Confirming.

crea’s picture

Title: Cannot Lock Threads » Nodecomments doesn't track changes to the node comment setting

I'm afraid this is a consequence of fixing #737570: Node_save() of a node with node comments sets the node's commenting settings to 'disabled'. The whole "disable $node->comment setting but save it as $node->nodecomment" stuff is a dirty hack to make Node Comments compatible with core Comment module. We can't revert #737570: Node_save() of a node with node comments sets the node's commenting settings to 'disabled' - node_save() should not disable comment setting generally (it happens lot in contrib modules), so the only "proper" solution to this problem I see is to track $node->comment changes and replicate them to $node->nodecomment (which we don't do), then restore $node->nodecoment to $node->coment during nodeapi presave op (as we do already).
This means the first thing we need to add is tracking of comment setting change on the node form. We will need to repeat this for every module that changes $node->comment setting and which we want to be compatible with.

crea’s picture

We could also use bigger numbers of $node->comment and get rid of $node->nodecomment completely. But it needs serious research on how would core and contrib modules react, and would this work at all.
Actually this seems to be most promising solition, but I don't have time for it, unfortunatly. Any volunteers ?

crea’s picture

Status: Needs review » Active

Cleanest approach would be to isolate from $node->comment completely, rather than reuse it. That would mean using own table for $node->nodecomment setting and implementing separate node form element to control the setting. But it would require more work than the change described in #3.

crea’s picture

Status: Active » Needs review
StatusFileSize
new663 bytes

Fortunatly we can detect if node was submitted via node form based on node object itself. So rather than track comment setting change, I simply not restore it when node is submitted via node form.
Please test this patch.

HuiJun-1’s picture

Status: Active » Needs review

Thanks for the patch crea! It works perfectly so far.

crea’s picture

Status: Needs review » Fixed

Committed

michelle’s picture

Thanks, crea. Sorry I never got a chance to test. I've barely had any computer time lately. :(

Michelle

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.