Kind of an odd bug that took me awhile to track down. When the workflow state of a node that uses nodecomments is changed, the commenting settings will change from the default of 'read/write' to "disabled".
I was able to reproduce this bug on a bare installation. Steps for reproducing are below:
- Install Drupal (I'm using 6.16)
- Install workflow, nodecomment modules (i'm using workflow 6.x-1.4 and nodecomments 6.x-2.0-beta3
- Set up a new workflow with two states, I used 'waiting' and 'published'. Make sure users have permission to access the workflow tab
- Make the a node type use nodecomments, defaulting to 'read/write', and make sure this node type uses the workflow you've created
- Create a new node of said type. After creation, go to the workflow tab (editing workflow settings under "edit" will not result in this bug), change the workflow state. Upon submitting, commenting will no longer be enabled.
Although changing settings under editing will not cause this bug, any scheduled state changes or changes via actions will.
If I can provide any assistance or more information please let me know
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | nodecomment_737570.patch | 560 bytes | crea |
| #2 | nodecomment.module.patch | 533 bytes | melsawy |
Comments
Comment #1
melsawy commentedsubscribe
Comment #2
melsawy commentedOn hook_noadapi case load If it's a node comment type the node->comment will disable and workflow tab changing status used node_save so the comments will be disabled .
I fixed it by comment this line.
Comment #3
crea commentedSetting proper status.
Comment #4
vood002 commentedI applied this patch, and although it fixed the workflow-state-change problem I referenced in this thread, it also caused all nodecomments to stop showing up on their parent node page.
Comment #5
crea commentedYes this is probably bad mechanics: any module could save modified node breaking the setting.
Comment #6
crea commentedPlease try this.
Comment #7
crea commentedMarked #633000: Content disables comment upon node_save manual run a duplicate of this.
Comment #8
crea commentedChanging title to reflect that it's programmatic save, not a user edit.
Comment #9
vood002 commentedI've installed the patch from #6 and after two days of testing it's been working great. Thanks for the support Crea! I'm changing status to reviewed & tested.
Comment #10
Narretz commentedI am not very familiar with the workflow module, but enabled it to get to know it and test the patch. Something strange happened though.
I can confirm accessing the workflow tab does not reset the comment settings anymore, but afterwards I could not change the settings manually. The changes simply are not applied, even though I get the "Story Test Story 2 has been updated." message, and no errors.
I disabled the workflow module, but I still cannot change the settings, so that leads me to believe it's caused by the patch only.
Comment #11
Narretz commentedSomething similar happened when I enabled "synchronize translations" on a node type with node comments.
Steps to reproduce:
- Have at least two languages defined
- enable a synchronize translations setting (I used taxonomy terms)
- create a node (nodecomments enabled)
- translate the node
in the source, the comment settings are set to disabled. Enable them, and the node's translation now has its comments disabled.
Comment #12
crea commented@Narretz your report seems to be unrelated. This patch only restores node comment setting. The code simply fixes the opposite operation during "load" operation of nodeapi:
I'm going to commit this, cause the bug is fairly critical. If it brings some incompatibility, let's fix it in a separate issue.
Comment #13
crea commentedComment #15
crea commentedCould you please help test the patch in #848598: Nodecomments doesn't track changes to the node comment setting so that we don't break this bugfix ?
Comment #16
kenorb commentedNote: For Drupal 7 use: COMMENT_NODE_HIDDEN constant