Support Views filters

Created on 26 November 2019, over 4 years ago
Updated 25 June 2024, 3 days ago

Problem
Password-protected pages appear in Views results because they are published, but technically inaccessible due to the password.

Request
I'd like a way to use Views to filter by whether or not a node is password-protected.

Because this module uses a path-based method for node protection and not entity-based, this may not be possible, but I'm putting it in as a feature request.

✨ Feature request
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jennypanighetti

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Merge request !11Issue #3096913: Support Views filters β†’ (Open) created by mikeohara
  • πŸ‡¨πŸ‡¦Canada mikeohara Moncton, NB

    I created the first pass at a super dirty implementation of a views filter to allow users to filter a view on whether the results are protected pages or not. (see merge request !11)

    It basically just extends the InOperator filter and allows a user to filter all results or specific node ids (pages). You can also flip to include or exclude these results.

    Currently, it leverages the loadAllProtectedPages() storage method to get the list of internal route paths, and then iterates them into an array. Views can then do a filter from that.

    I hope this helps frame a solution, but this does seem, in limited testing on my end for my own needs, to solve the problem.

  • πŸ‡ΊπŸ‡ΈUnited States COBadger

    @mikeohara great work on this patch. Wish I had time to further develop it, but in any case for my limited use case (filtering nodes) this patch solves the problem. I won't mark it as RTBC because we need test coverage, but here's a hearty +1 for what you have done so far.

  • Assigned to Bobik
  • πŸ‡ΊπŸ‡¦Ukraine Bobik
  • Issue was unassigned.
  • Status changed to Needs review 5 days ago
  • πŸ‡ΊπŸ‡¦Ukraine Bobik

    HI
    I fixed PHPCH, created test coverage for the Protected Pages View Filter, and fixed the bug for the Select All option that I found while working on the test.
    Please check it

  • Status changed to RTBC 3 days ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thanks @bobi-mel this looks impressive! RTBC!

Production build 0.69.0 2024