Views currently doesn't have Context Filter support for the publishing options for nodes. Specifically the Status, Promote and Sticky fields.

I get that these are bit fields that really don't *need* context filters for the purposes of URL handling, but it would be nice to have them for things like generating summary lists that show count totals in a facet like way.

Attached is a patch that adds context filter support for these fields. Additionally I've included an exported view (in the .txt file) that demonstrates the usage of these context filters (once the patch is applied).

Lemme know if I need to make any changes to it!

Files: 
CommentFileSizeAuthor
#7 2017109-5_views_publishing-options-context-filters.patch6.11 KBnetw3rker
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 75,124 pass(es).
[ View ]
#5 2017109-5_views_publishing-options-context-filters.patch6.11 KBnetw3rker
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2017109-5_views_publishing-options-context-filters.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
views-publishing_options_context_filters.txt17.14 KBnetw3rker
views-missing_publising_options_context_filter-0-0.patch5.92 KBnetw3rker
PASSED: [[SimpleTest]]: [MySQL] 1,658 pass(es).
[ View ]

Comments

netw3rker’s picture

Category:feature» bug

I guess this isn't so much of a feature request as it is a bug report (node options should have context filters, but they don't exist).

bryanbraun’s picture

The patch applied cleanly for me, and everything worked as expected. Nice work!

kyberman’s picture

Issue summary:View changes

Great, it works fine. Thank you. But in case of "Provide default value" with "PHP code", you need to return 1/0 instead of true/false. Otherwise it returns 404.

netw3rker’s picture

Status:Needs review» Reviewed & tested by the community

changing status...

netw3rker’s picture

Project:Views» Drupal core
Version:7.x-3.x-dev» 8.x-dev
Component:node data» views.module
Category:Bug report» Feature request
Status:Reviewed & tested by the community» Needs review
StatusFileSize
new6.11 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 2017109-5_views_publishing-options-context-filters.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

8.x port. Moving to Drupal core's views queue. The Handling of on/off labels is different in the 8.x patch than the 7.x patch. I'm going to rework the 7.x patch to be inline with the way 8.x handles things. That should reduce the 7.x patch size a bit.

Anyhow, hopefully this will get things moving :)

Status:Needs review» Needs work

The last submitted patch, 5: 2017109-5_views_publishing-options-context-filters.patch, failed testing.

netw3rker’s picture

StatusFileSize
new6.11 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 75,124 pass(es).
[ View ]

Thats what I get for removing cruft inside the patch.. one day I'll learn. Lets try again.

netw3rker’s picture

Status:Needs work» Needs review
dawehner’s picture

Status:Needs review» Needs work
Issue tags:+VDC, +Needs tests

Sounds like a good idea in general! Thank you for your patch. Sadly this patch will need a reroll, and maybe some tests.