Jump to:
| Project: | Node Comments |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | actions, Node Comment, rules |
Issue Summary
I'm working on a project in which I have four different content types. The first content type contains personal information, and the other three content types have node comments enabled and are related to the first content type. I needed to automate the creation of the other three nodes when an informational node was created, so I used Rules to create each new node and populate relevant fields.
The problem is that when Rules is used to create new nodes that have node commenting enabled, the commenting does not get set up. There is no "Add a Comment" link on any node that is created with Rules "Create a Content" action, the nodes just basically act as if commenting were turned off. I double checked my setup by creating the nodes individually and it works properly in that case, so there is no issue there.
I am working with a lot of data so this capability would be a big help, but nevertheless, this module still bailed me out of a lot of work already, so thanks!
Comments
#1
Node Comments module does dirty stuff with the comment settings. Many would call it a hack, actually. This wasn't my decision - it was made by previous maintainers to keep the module compatible with the core comment module. So bugs like this can show here and there. This is inevitable because the module actually pushes Drupal to the limits in terms of CMS stuff.
To describe in detail, the module disables comment setting when loading node, copies it to own setting (for node commenting) and restores it in "presave" nodeapi operation. What probably happens is something breaks the "restore" part.
I don't have time to troubleshoot this properly, and I don't use Rules much these days. I hope someone will be able to solve this, given these clues.
#2
Not problem! I had forgotten about this actually and I found a different way to accomplish what I was doing, but it is an interesting bug. Maybe when I get some time I will revisit it and see where this is getting skipped. It sounded to me like a conflict with the way rules programmatically creates nodes. Seemed like Node Comment just somehow misses the node being created.
#3
This should be fixed in 3.x
The bug was caused by hacking around core comment module setting. In 3.x we don't have own "commentable" flag in the DB anymore - we simply use the flag from the comment module.