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.

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

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..

ycimlynn’s picture

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?

ycimlynn’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

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...

ycimlynn’s picture

Status: Closed (fixed) » Active

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?

jcnventura’s picture

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

ycimlynn’s picture

Excellent! I will stay tuned until I hear from you then. Thanks so very much for the quick response. It is greatly appreciated.

Lynn

zed_den’s picture

Hi,
i discovered this FeatureRequest, and i need exactly the same feature.

btw: you did a great work!

duckzland’s picture

I'm faced with similar issue and since it is not really possible to alter node_access and node_grant is useless if the content type is created by node module / cck module, my only solution only is to hack print.pages.inc on line 491 and uncomment the else if :

  /**
  elseif (!node_access('view', $node)) {
    // Access is denied
    drupal_access_denied();
    return FALSE;
  }
  **/

maybe we could implement a custom access function that is hookable?

perhaps something like this :


function print_node_access($mode, $node) {

$output = node_access($mode,$view);

$output = module_invoke_all('print_node_access' , $output);

return $output;

}

/**
  * in the commented out function
 **/

elseif (!print_node_access('view', $node)) {
drupal_access_denied();
return false;
}

so other module can decide / alter the access rule?
note: the code above is just written out of my head without testing, dont use it unless you are proficient with php

aaroninaustin’s picture

I know this is an old issue, but was it ever resolved ? I am in the same situation, using Content Access module as well. Seems like your solution would work, but I'm worried about conflicts with other ACL modules out there.

jcnventura’s picture

Version: 6.x-1.8 » 6.x-1.x-dev
Status: Active » Postponed

No, it was never resolved.. And there's no plans to resolve this in the short run. Each of those custom access modules work in their unique way that I'm not sure I could ever fix this to everyone's satisfaction. The only thing I'm sure would happen is that the code would be a lot more complicated.

As it is, if your user/role has access to unpublished nodes, you should be able to get a printer-friendly version of it. Using a custom module to circumvent Drupal's normal way of handling permissions is not supported.

Moving this to 'postponed' limbo.

jcnventura’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

Closing all issues related to the Drupal 6 version of the print module.