Needs work
Project:
Content Access
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2018 at 12:52 UTC
Updated:
6 Jul 2026 at 13:46 UTC
Jump to comment: Most recent
After enabling the content access module , content authors are not able to see unpublished content created by them.
Any ideas , what I am doing wrong?
Thanks in Advance!!
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
gisleThis is fixed in the Drupal 7 version. Patch in #1225520: Add 'View own unpublished content' setting needs to be ported to Drupal 8.
Comment #3
gisleThis may depend on this being fixed in core: #2971902: Unpublished content is not visible in views to users with the 'view own unpublished content' permission when used in combination with node grants?
Comment #4
gisleAll bug fixes go into the most recent branch.
Comment #5
steven jones commentedOh fun, looks like core now expects us to do different things for unpublished nodes: https://www.drupal.org/docs/develop/drupal-apis/writing-a-module-that-ha...
We should get some tests on the go to confirm what the current behaviour is and if we need to change content access. It might be that we need to make a listing page so that we rely on the node grants DB tables entirely, rather than some access callback.
Comment #6
steven jones commentedI can confirm that with a user that can view unpublished content, they can view a node directly, but in the listing for nodes, say in a view, there's no grants for that node in the database, and so the user can't view that node in the listing.
So yeah, this needs a test, and then probably a fix to get this working. Given that I'm thinking of jumping to a 3.x version of the module I'm wondering if it would make sense to do it in that version, and then we don't spring unexpected changes on site owners in a 2.2.0 release, because this could have weird side effects maybe?
I know that I have a site where I actually process the unpublished nodes through something that looks basically like content access' code, so that the unpublished nodes have the correct records and can be viewed in listings. And I'd like to kind of have notice that I'd need to adjust that.
Comment #7
steven jones commentedI reckon we should implement 'view_unpublished' and 'view_own_unpublished' type settings, that mirror the 'view' and 'view_own' settings that we have already, so that people can configure their sites appropriately.
Comment #9
steven jones commentedMade a start on this one, at the moment only handling the view and view own cases for unpublished content, but that's because I think core handles the edit and delete cases for us? Anyway, something to check on I suspect.
I did think it made sense to do this one before #3579507: Re-work the author grant realms but I think that one simplifies the code so much that actually, we might want to do that one first, and then this one.
The code around the owner stuff is super complex at the moment because it's trying to do the job of the node_access system for it.
And while I think of it...do we need new realms here? I don't think we do as they'll be a direct mirror of the usual ones for published nodes.
Comment #10
steven jones commentedI think we can work on this now.