Views Bulk Operations

kratib - July 23, 2007 - 21:39

PHP 5 needed! It's time to let go of the past!

As featured in Lullabot Podcast #64: dubbed the cherry on top and the cat's pyjamas :-) Thanks gods of Drupal for your endorsement!

This module augments Views by allowing bulk operations to be executed on the nodes displayed by a view. It does so by showing a checkbox in front of each node, and adding a select box containing operations that can be applied on the selected nodes.

Drupal 5 / Views 1

The module works by exposing a new Views style plugin called "Bulk Operations View". Creating a view with this style displays a wizard-like form with the following elements:

  • A table view containing the queried nodes, with a checkbox in front of each. Exposed filters and pager are supported.
  • A drop-down with available operations. Operations are gathered from two sources: 1) actions defined with the Actions API having type {'Node', 'Workflow', 'Email'} and attribute 'batchable'; 2) operations returned by modules that implement hook_node_operations. In addition, each Bulk Operations view allows the selection of one or more such operations to be shown in the drop-down, through the "Operations" tab that appears next to "View", "Edit", "Clone", "Export" tabs. NOTE: By default, no operations are selected for a new Bulk Operations view. It is necessary to explicitly select one or more operations from the "Operations" tab before the view is functional.
  • In case only one operation is selected from the "Operations" tab, no drop-down will be shown. Instead, the submit button label will be modified to reflect the chosen operation's name.
  • Some actions from the Action API provide a form to gather user parameters before the action is executed. If such an action is chosen from the drop-down list, the user will be shown the action parameters form as a second step. In case only one operation is selected from the "Operations" tab *and* this operation has a parameters form, this form will be shown on the first page for more intuitive usability.
  • Finally, a confirmation page is displayed with the chosen operation and the selected nodes.

Drupal 6 / Views 2

The module works by exposing a new Views 2 Style plugin called "Bulk Operations". The settings for this plugin allow to choose the operations that should appear on the view. Operations are gathered from two sources: 1) Action API 2) hook_node_operations and hook_user_operations. The module also allows to use Batch API to process the selected nodes, in order to avoid timeouts.

A significant change from the D6/V1 version is that VBO can support all object types supported by Views. Natively, VBO comes with support for nodes, users and comments. Through hook_object_info(), other modules can let VBO handle other object types. Refer to function views_bulk_operations_object_info() for information.

Example VBO

As an example, the module comes with a re-implementation of the Content admin page. To access it, just go to the URL admin/content/node2.

Taxonomy Action

The module comes with a new action to manipulate nodes' taxonomy terms. Unlike Taxonomy Node Operations, which creates a new action for each single term, this module exposes a single configurable action that allows the user to choose which term(s) should be added to the selected nodes. The user can also choose to keep existing terms or to erase them.

Releases

Official releasesDateSizeLinksStatus
6.x-1.22008-Oct-1014.44 KBRecommended for 6.xThis is currently the recommended release for 6.x.
5.x-1.12008-Sep-0717.15 KBRecommended for 5.xThis is currently the recommended release for 5.x.
Development snapshotsDateSizeLinksStatus
6.x-1.x-dev2008-Oct-1214.87 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.
5.x-1.x-dev2008-Oct-1117.19 KBDevelopment snapshotDevelopment snapshots are automatically regenerated and their contents can frequently change, so they are not recommended for production use.
 
 

Drupal is a registered trademark of Dries Buytaert.