You are here

function hook_views_bulk_operations_object_hash_alter in Views Bulk Operations (VBO) 6

Hook used by VBO to alter the way views results are indexed.

Indexing is essential to remember the selected objects between the server and the browser. This hook is useful for situations where the view query can return multiple rows with the same object primary id, as in the case of multiple-valued node reference fields returned separately.

1 invocation of hook_views_bulk_operations_object_hash_alter()
_views_bulk_operations_hash_object in ./views_bulk_operations.module
Helper function to calculate hash of an object.

File

./views_bulk_operations.api.php, line 57
Documentation of hooks.

Code

function hook_views_bulk_operations_object_hash_alter(&$hash, $object, $view) {
  if ($view->name == 'my_view_name') {
    $hash = md5($object->nid . $object->field_node_reference_nid);
  }
}