I have a view that's using node_revision as the base table, and when I try to add the Search Terms filter to the view, it's not in the list of filters (see attached screenshot).

I've tried:

  • Searching the Views code base for implementations of hook_views_data_alter() that might be removing that filter under some condition
  • Added relationship: “Content revision: Content (The revision NID of the content revision.)”
  • Added relationship: “Content revision: Content (The revision ID of the content revision.)”
  • Removing all the other filters on the view (on the hunch that there could be some kind of conflict)

Any suggestions to bring that filter back?

CommentFileSizeAuthor
viewfilters.png25.91 KBBrockBoland

Comments

Mołot’s picture

As far as I remember search index only indexes latest (aka current) revision of a given node, so the way it is now filter you ask for would not make any sence anyway.

greggles’s picture

Status: Active » Fixed

Based on comment #1 marking this fixed.

Mołot’s picture

I dunno, maybe OP has some specific problem and filter like this would be legitimate for him, no matter how illogical it seems to me?

BrockBoland’s picture

Nah, we kind of gave up on this and just exposed a filter on the title field instead.

But, if you're curious what I was trying to do: I have a site using Workbench Moderation, and was building a view to report on the various moderation states of nodes. With that module, you can create a new, unpublished draft on a node that is published—so, revision 123 might be published, while revision 124 is not (while a content admin works on changes to the node). I needed a view to show the details from the latest revision of each node, not the published revision, and to expose a filter to search the details of those latest revisions.

Not do-able, but we found a good-enough-for-now solution.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

damonbla’s picture

Issue summary: View changes

Hello BrockBoland, I was wondering if you could mention that good-enough-for-now solution you came up with. We are running into this problem right now (using Workbench Moderation) and can't get our views to show the unpublished drafts. It's always the published version. Thanks for any help!

BrockBoland’s picture

I honestly can't remember now, but I'm pretty sure that we just added a filter on node title instead of doing a Search Term filter.

To use the latest drafts in a view:

- Build a view using Content Revisions as the base table
- Add relationship for Workbench Moderation: Node
- Add a filter for Workbench Moderation: Current (yes)