Print Unpublished Nodes
ycimlynn - October 19, 2009 - 21:46
| Project: | Printer, e-mail and PDF versions |
| Version: | 6.x-1.8 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
It would be nice to be able to print unpublished nodes. When you are a person working on a node, you may want to print off the node content before it is published to the public.
Now it appears that the print icons will appear, however, it gives you a page not found if you actually click on the link.

#1
I have just tested and it works fine.. You have to be logged in with sufficient privileges to access the original node, but it does work..
#2
Just tried it again. The role has the following permissions:
access print = TRUE
adminster print = TRUE
node-specific print configuration = TRUE
use PHP for link visibility = FALSE
I am using the module content access for node access control. They are able to view and edit the node without any issues.
Here is my testing data:
Viewed the node (no issues)
Edited the node (no issues)
Node is in unpublished state
The print icon and the email icon does appear at the bottom of the pages. However, when you click on the print icon, it gives an "access denied". when you click on the email icon, it works fine.
Then I published the node.
Viewed the node (no issues)
Edited the node (no issues)
Node is in published state
The print icon and the email icon does appear at the bottom of the pages. However, when you click on the print icon, it works fine. when you click on the email icon, it works fine.
The only difference between them is that the node is unpublished.
If it works fine for you, I wonder if this could be a module conflict? I also had this module enabled, but I disabled them, and still the issue continues.
*Override Node publishing options
Thoughts?
#3
I found it (i think).
I had another module temporarily installed called Publish content. The 2 modules are in conflict. Disabling the module publish content makes it work fine.
Thanks anyway...
#4
OK...I take it back. Sort of...
I was almost right with the assessment. The problem is when you want to allow a user to view a node without given them full administer nodes permission.
When you install the Publish content module, it falsely gives a view access, so that the user can actually view the node without having the administer nodes permission. However, when the print module tries to view the same node, it cannot as it doesn't have the correct access permissions.
Because the node is still unpublished, the content access module doesn't yet allow view access, as this only works on published nodes.
So by disabling the Publishcontent module, you no longer have view access,and this solves the problem.
However.....
I then installed the view_unpublished module. It does the same thing. I can see the node (which is the behaviour that I want), but when I try to print the node I get an access denied.
If I set permissions to "administer nodes", then print works fine. But in our case, we don't want users to be able to administer all nodes. Just the ones that are pertinent to them.
Make more sense?
#5
Both modules you tried work in the same way: through a hook_menu_alter() call, they alter the access rights to the menu entry.. The print module actually calls the node_access() function which checks the low-level permissions. However, in the case of Drupal 6, I think I know how to discover if the user has the right to access the node via the menu system.
João
#6
Excellent! I will stay tuned until I hear from you then. Thanks so very much for the quick response. It is greatly appreciated.
Lynn