Hi,

I'm building a site using nodecomment but I'm having some troubles.

I have set up two content types just for testing, before posting this issue.

The two content types are called as follows:
- parent
- child

The "parent" content type is used as the parent node type, and the "child" content type is used as the 'nodecomment' comment.

Now, when I go to a parent node I get a link to "add a new child".

Clicking on the link I'm taken to the following URL: http://host.local/node/add/child/17
(It's on a local demo machine)

But trying to go to http://host.local/node/add/child (without the argument of the parent node) I'm getting an error: Access denied. You are not authorized to access this page.

This happens even when I'm logged in as administrator.

Please note that on the nodecomment settings page I left the 'Is Content' check intact for all content types including the 'child' content type.

Comments

drupalmeister’s picture

I think the problem might be in the this function:

function _nodecomment_node_add_access($op, $type) 

Can anyone please clarify when this function is being called?

(Note: I happen to believe that it gets called only if the 'parent' node comment settings are set to appear on a different page, but not if you set the comments to appear on the same page.)

crea’s picture

It's not a bug. Nodecomments should always have parent node context. It may change later, but now it's a strict requirement.
And it's documented in the README

Comment types can be enabled to work as "content", meaning they will have own
pages, full node titles (independently from the comment settings) and generally
behave as content. The only requirement currently is they must be added in
comment context, i.e. via "Add new " link for their target node.

crea’s picture

Status: Active » Closed (works as designed)