Module works great, but it *always* shows "page not found", even if a node is published *but* the user does not have access to view the node. I believe modifying the module in the following way would only show the "page not found" message if a node is unpublished, but would show "access denied" when a node is published but the user does not have permission to view it:
function unpublished_404_node_page_view($node) {
// check status, show 404 if unpublished
if ($node->status == 0) {
$node_content = MENU_NOT_FOUND;
}
// if published, check access
elseif (!node_access('view', $node)) {
$node_content = MENU_ACCESS_DENIED;
}
else {
$node_content = node_page_view($node);
}
return $node_content;
}
This may not be the best method to do so, but regardless it would be a nice feature...
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix_admin_node_view_2941746_04.patch | 531 bytes | RAWDESK |
| #3 | keep-access-denied-when-apropos-2941746.patch | 631 bytes | butterwise |
Comments
Comment #2
butterwise commentedComment #3
butterwise commentedAdding a patch with the aforementioned update.
Comment #4
RAWDESK commentedHi,
Patch at #3 is not completely correct.
If you apply it and view the node as logged in user, you receive a 404 when node is unpublished.
Attached patch fixes this.
Also will this patch cohabitate better with r4032login module, allowing accessed denied to be rerouted to login form.
Comment #6
captainpants commentedThanks for your contribution folks! This issue has been resolved in 7.x-1.2.