3

I inherited a Druapl5 site and it's showing content when published is not checked in the Publishing Options section of the Edit Content Form.

I confirmed that the status is 0 in the DB for the node. So it should be not visible.

My first guess was that I was logged in and that's why I could see it, but I logged out and I could still see it. I tried a different browser and the same thing so it's not that.

Also, the unpublished nodes are coming up in the search results which I originally thought was an out of date search cache, but may be something different.

Ever seen anything like this? Any ideas?

easement
  • 6,119
  • 3
  • 29
  • 36

5 Answers5

3

You mentioned in a comment that Content Access is installed on the site. This module (as well as several others, e.g. ACL) overrides the default Drupal node access mechanism in order to provide additional/more fine grained permission settings.

So my guess is that the permission configurations in that Module are configured wrong for your desired results. As far as I recall, it allows separate permission sets per content type (defined for authors and roles). You should look at your content type edit/definition pages - there should be a tab added by that module to configure the permissions. Also check the readme.txt of the module, as it might give some additional hints.

If that does not help, you should check if other node access modules are installed as well. As mentioned, there are quite a few of them, and their interactions are not easy to determine (One should aim to use only one, if possible).

Henrik Opel
  • 19,341
  • 1
  • 48
  • 64
  • just for the record... this also happened to me and ended up being because I had 2 modules that controlled the published status: [Moder8](http://drupal.org/project/modr8) and [LM Paypal](http://drupal.org/project/lm_paypal). Nodes were being approved with Moder8 and thus _published_ but LM Paypal was still saying they were unpublished when in fact they were, so nodes were getting published without paying. – Naoise Golden Jun 13 '11 at 23:09
2

Are you using Views? If so, make sure you have a filter set to show Published only.

I ran in to a similar problem with comments, which lead to some excellent spamming opportunities until I discovered it.

MattBelanger
  • 5,280
  • 6
  • 37
  • 34
1

Rather strange. No answers, only guesses:

Try accessing admin/content/node-settings and click on Rebuild permissions.

And maybe clear the cache admin/settings/performance

1

Check your permissions for anonymous users. Seems like somewhere they have the wrong permisions.

googletorp
  • 33,075
  • 15
  • 67
  • 82
  • As far as permissions, the only one for anonymous user that is checked in the node module is access content. – easement Oct 23 '09 at 20:42
  • There is also a module called Content Access, but it only provides access and not edit. Any other ideas? – easement Oct 23 '09 at 21:02
0

All access modules override the default settings while using hook_node_access(). Most likely this is the problem. So you need to tweak those settings in the content access portion.

And this is not the best solution. But if you need something in the interim you can always put this code in the node.tpl.php file:

if(!$node->status && $user->uid != 1){

with code added:

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">

<?php print $picture ?>
<?php

if(!$node->status && $user->uid != 1){

?>
<?php if ($page == 0): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

  <div class="meta">
  <?php if ($submitted): ?>
    <span class="submitted"><?php print $submitted ?></span>
  <?php endif; ?>

  <?php if ($terms): ?>
    <span class="terms"><?php print $terms ?></span>
  <?php endif;?>
  </div>

  <div class="content">
    <?php print $content ?>
  </div>

<?php
  if ($links) {
    print $links;
  }
}//if for published node
?>

</div>
lilott8
  • 1,116
  • 2
  • 17
  • 41
  • 1
    Only allowing user 1 is a bad hack. – googletorp Oct 24 '09 at 19:56
  • This is supposed to be an interim solution. As stated in my post. If you wanted to turn this into a usable, long term solution you would change && $user->uid ==1 to allow for any user that is allowed to administer nodes. – lilott8 Oct 26 '09 at 16:10