3

I'm using VBO to bulk update taxonomy terms on my nodes. I'm running into an issue when using workbench that VBO only updates the published revisions, and doesn't touch any of the drafts.

The problem with this is that when there are drafts, the published revision is not the newest revision. So by updating the published revision via VBO, then later publishing a draft, the taxonomy changes done with VBO do not carry forward, since they are part of an older revision.

How do I use VBO to only update the latest revision (whether this is a draft, or published content)?

2
  • All revisions? Is that a good idea? It would seem to break the idea of having revisions. I could tell you how to update the most recent revision, but I'm not sure how to get VBO to update multiple records at the same time unless you have the view display every single such record, which would probably end up being huge.
    – meustrus
    Commented Jul 28, 2014 at 14:17
  • You are right. I have updated my question to better define my problem. If you know how to update the most recent revision, feel free to post an answer.
    – bkildow
    Commented Jul 28, 2014 at 15:16

1 Answer 1

4
+50

The basic principle behind using Views to display the latest revision, instead of the published revision, is to base the view on the node_revision table instead of the node table. Unfortunately you cannot change the base table of an existing view, so you'll have to rebuild the entire view showing "Content revisions" instead of "Content".

To display only the current revision, use the filter criteria "Workbench Moderation: Current" on the node_revision table (otherwise all revisions will be displayed). To gain access to fields on the node itself, add a Relationship of "Workbench Moderation: Node" (and then be really careful you don't use this relationship unless you intend to reference the published node).

To avoid a potential security bypass in your view, you should also include the filter criteria "Content access: Access" on the Node relationship.

With all that plumbing out of the way, you should now be able to edit the taxonomy term field on the most recent revision of your nodes using "Content (historical data): [taxonomy field name]".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.