Unpublishing a FAQ node leaves it visible to everybody. I tried re-building the node-access status, but that does not change anything. Also installed is og7.2, but other nodes in the system behave as expected.

See http://drupal.org/node/274183

CommentFileSizeAuthor
#3 faq_5x_277349.patch1.17 KBstella
#3 faq_6x_277349.patch1.18 KBstella

Comments

jhm’s picture

The fix is to modify the hook_access for $op == 'view' and && the $node->status to the return value

return user_access('view faq') && $node->status;

So the hook_acccess for the faq module looks like this:

function faq_access($op, $node) {
  global $user;

  if ($op == 'create') {
    if (user_access('create faq') || user_access('administer faq')) {
      return TRUE;
    }
  }
  else if ($op == 'update' || $op == 'delete') {
    if (user_access('edit faq') || user_access('administer faq')) {
      return TRUE;
    }
    else if (user_access('edit own faq') && $user->uid == $node->uid) {
      return TRUE;
    }
  }
  else if ($op == 'view') {
    return user_access('view faq') && $node->status;
  }
}
jhm’s picture

Status: Active » Needs review

changed status to patch

stella’s picture

Status: Needs review » Fixed
StatusFileSize
new1.18 KB
new1.17 KB

This issue has now been fixed and will be included in the next dev release later today. Please try one of the attached patches (depending on your Drupal version) for the proper solution.

jhm: your solution didn't account for users who created unpublished nodes - they should have the right to see their own unpublished nodes.

jhm: next time you need to create a patch, please see http://drupal.org/patch/create on how to do this.

Thanks for spotting this bug!

Cheers,
Stella

jhm’s picture

Thanks. As you can tell from my late response, I was too busy to even create a patch.

Will do next time.

The patch works, I think this can be closed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

stella’s picture

Released in 5.x-2.12 and 6.x-1.8.

lukas.weber’s picture

Version: 5.x-2.11 » 6.x-1.13

Still seems to be a problem in views. while the node is not accessible directly, it turns up in views (not if I explicitely restrict to published content of course).