Closed (fixed)
Project:
View Unpublished
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Reporter:
Created:
4 Sep 2008 at 22:21 UTC
Updated:
6 Nov 2011 at 16:28 UTC
Jump to comment: Most recent file
Comments
Comment #1
ramper commentedHere's one more person who would really like to see a D6 version of this module that could act like a "force multiplier" by making other modules such as workflow that much more useful :)
Comment #2
arnoldc commentedHere's my first crack to work on a Drupal module. I have tested it in conjunction with Workflow module in Drupal 6 and seem to work well.
It passes code check from Coder except the node_load() function. Coder asks me to use "menu_get_object()" but I seem to run into "infinite" loop if I try to use the new method. So I just stick with the old "node_load" method for now. May be someone has a better idea how do make it to work....
*Notes
For those new to this module, access control of this module is only applicable to those users under these conditions:
1. they have no "administer nodes" permission
2. they have "use view_unpublished module" permission
Then you can configure view unpublished permission based on content_type accordingly.
Comment #3
ramper commentedHi arnoldc
I was excited to see your post - and immediately wanted to try out your 'first crack' :)
I installed the module as usual, made sure "administer nodes" permission was not granted, and the roles had "use view_unpublished module" permission as well as permissions for some of the content types in the workflow I'm setting up.
I still get the "Access denied" message.
I'm not sure if I'm overlooking something.
Here's my situation:
I have a workflow with states 'Draft', 'Review', etc. I need the 'view_unpublished' access for a couple of roles. I don't know what I'm overlooking here.
BTW, does this module allow only 'View', or does it allow 'Edit' as well?
Comment #4
arnoldc commentedDid you happen to download the very first attachment as soon as I made the post? I have replaced with v01 zip file since then.
Make sure all users have "access content" right. I invoke the nodes from Workflow summary. I enable "access workflow summary views" and disable "administer workflow" permission for both editor and publisher roles. You should be able to use the "create/edit/delete content" permission to refine the access right as you see fit with your own publishing cycle.
I test it with a very stock Drupal setup, may be it is influenced by other modules. I found access permission is a very tricky business in Drupal.
Comment #5
ramper commentedI thought so too - I have long since disabled the other modules that could potentially interefere. I checked the workflow settings summary page - the permissions look all right (in fact they work perfectly for published nodes :) I've set the permissions for 'view_unpublished' correctly, including 'use this module'. And the roles do not have administer nodes permission. Hmm... it must be something else... So for now, I'm just going to leave the nodes published as they move through the workflow while I figure out the problem. Though it's potentially less secure that way, the workflow permissions for various states seem to be holding up - so though the nodes are published, they are not accessible except for the respective roles.
Thanks again for the reply. (To be sure, I tested again with your current zip file). If you think of any other reason why it's not working for me, I'd appreciate hearing from you.
Comment #6
CalebD commentedAttached is my take on a Drupal 6 version of this module.
Changes:
Thanks!
Comment #7
Dab-1 commentedWell done mate!
Testing this currently in conjunction with workflow and no other access modules to implement a simple reviewing system. Works fine, at first glance. Will comment on any issues.
Comment #8
arnoldc commentedGood job, Caleb. Simple and elegant. Work great with Workflow. You should consider to create a D6 branch for it.
Pass Coder except really minor stuff.
Comment #9
suydam commentedCalebD, this is a great module! You really should consider getting CVS access and committing this.
Maybe there's some other way to do it, but I've not seen one and this appears to work great.
Comment #10
slosa commentedAny idea if this will be a download available for Drupal 6 any time in the near future?
Comment #11
arnoldc commentedIt is available as in message #6 of this thread. Just no one officailly moves it to the proper download section.
Comment #12
scottrigby#6 works really well - nice! Only problem is this doesn't display in views lists, even if you have permissions (because the only available filter for viewing unpublished content in Views now is 'published or admin'). This module could provide a views filter however, and then it could work :)
Comment #13
michaelj commentedsimpe and work great, thanks
Comment #14
garrettc commentedI've created a patch against the most recent 5.x release using CalebD's work. I also took the opportunity to fix the Coder issues regarding string concatenation.
Comment #15
mutzel commented@garrettc: I tested your patch and it worked very well for me. Thanks!
Comment #16
i.chris.jacob commented#6 CalebD - works perfectly! However I did make a minor change to allow for commenting against unpublished nodes. Note: If you use this code I suggest using 'Flush all caches' in the module Administration Menu (http://drupal.org/project/admin_menu) - otherwise the new Menu Alter will not take effect.
Change made in view_unpublished.module replaces the existing function: function view_unpublished_menu_alter(&$items)
/**
* Implementation of hook_menu_alter().
*
* Modifies the path node/nid to use our access callback.
* Modifies the path comment/reply/nid to use our access callback.
*/
function view_unpublished_menu_alter(&$items) {
$items['node/%node']['access callback'] = '_view_unpublished_node_access';
$items['node/%node']['access arguments'] = array(1);
$items['comment/reply/%node']['access callback'] = '_view_unpublished_node_access';
$items['comment/reply/%node']['access arguments'] = array(2);
}
Comment #17
killes@www.drop.org commentedI suggest that somebody moves to take over this apparently abandoned module.
Comment #18
a_c_m commentedi will take over the module if need be. I will log the request tomorrow unless anyone else steps up.
Comment #19
lelizondo commentedmore than 3 users said this is working, I think it should be moved to the next status.. If someone takes over the project, please tell us what's the new name so we can receive updates from update_status.
As the original post said, workflow should include this by default.
Comment #20
bartezz commentedThanx for this CalebD and others, I was looking for a D6 version and will give this a go.
Would be nice to see it as an official D6 branch though.
Big Thumbs Up
Cheers
Comment #21
NaX commentedPatch worked for me.
Thanks.
Comment #22
borisbarowski commentedI used CalebD's version: it was exactly what i needed and worked without a problem
Comment #23
christefano commentedThe patch shouldn't delete the install file as it should be removed using CVS instead. There are a few lines in the info file that should be left alone since they're written by the package release system. I'm sorry to kick this back to "needs review" but it needs a simple retest.
Also, can the code change that's proposed in #16 please be considered after the Drupal 6 upgrade? That would actually necessitate an install file and we can require a visit to update.php at a later time to run something like this:
Comment #24
entendu commentedTagged and released for D6. Thanks, CalebD!
Comment #25
rstuker commentedSorry to be negative, but i cant make it work. I use D6.15 & postgres. In my permission admin i give to users of a rol the permission "view all unpublished content" and another of "view all contentX type" permission. I make sure no to give them "administer nodes" allowance. But, where the user who has permission to see unpublish content, can make the search, no option in menu appears for him to find that content. I may have missed something, i do apreciate any help.
pd= I dont use workflow module, use TAC and Content Access. Thanks. The version I user is 6.x
Comment #26
hixster commentedJust wondering if the fix for comments from post #16 will be committed? Should the module expose some permission for commenting on unpublished content types too?