Unpublished nodes not showing in Drupal 7 Views article listing for a specific user

When we have to show content related to a specific user, we use Drupal’s permission system shipped with it and it certainly does the job, but there was this one time when i had to show a simple View of a list of a logged in user’s articles.

Apparently for advanced users it must be a simple job. i.e. setting the permission of content type from Permissions section. Well, i googled and that is exactly what i had to do but it still won’t show the unpublished nodes. This was quite frustrating since there was nothing related to unpublished node type in the permissions section.

But after some search i cam upon a response on stackoverflow that said something about SQL Rewriting and View. So i tried this one solution that did the job for me and disabled SQL Rewriting in the Query Settings of the view under the Advanced section. And voilà: listing served!

unpublished-nodes-not-showing-drupal-7-views-article-listing-specific-user

Turns out the real reason was the node_access which the Views use to check access rights but unpublished nodes are removed from this table somehow.

alexey

Application developer, movie buff, occasional reader and a huge Manchester United fan.
alexey
Share

Application developer, movie buff, occasional reader and a huge Manchester United fan.