Project:Composite Layout
Version:6.x-1.0-beta6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I'm pretty new to both Drupal and the Composite Layout module so I'm not sure if this is really a bug, but I created a composite node and put four other nodes in it, then published the composite node and the other four nodes. Then I updated one of the four nodes and left the update unpublished, but the unpublished content showed up in the composite node even when I logged out of admin.

Comments

#1

It may be related to your permissions configuration rather than Composite Layout.

> Then I updated one of the four nodes and left the update unpublished, but the unpublished content showed up in the composite node even > when I logged out of admin.

If you try to view the unpublished node on it's own, can you view it without causing an error message to appear? Even when totally logged out?

If so, then your site is probably set up to allow anyone to view unpublished nodes.

#2

If I try to view the unpublished node on it's own when logged out I get an Access Denied error. The composite node shows teasers for the four sub nodes and if I'm logged out and click the "read more" link in the unpublished one I get Access Denied.

Here are the boxes I have checked in User Permissions in the anonymous column:
- access comments
- post comments
- access content
- vote on polls
- search content
- use advanced search

#3

Status:active» fixed

Ahh, my mistake. You are correct. Composite Layout isn't respecting node access permissions when displaying composite items which are nodes.

A fix has been committed to cvs and will be in the next release of Composite Layout (whenever that will be).

In the meantime, if you don't mind editing PHP files, here is the fix:

In the file composite.node.inc, change line 31 from:

      if ($node->nid) {

to:

      if ($node->nid && node_access('view', $node)) {

In other words, add the second boolean condition. When you attempt to make this change, please copy and paste the entire line, don't try to type it in by hand.

Thanks for reporting this.

#4

Thanks so much! I'll put that fix in right away. Thanks for creating a really great Drupal module!

#5

Status:fixed» closed (fixed)

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