The views_bulk_operations_config_form() function (which creates the configuration form for VBO actions) sets the page title to "Set parameters for %operation". (http://cgit.drupalcode.org/views_bulk_operations/tree/views_bulk_operati...)

This does not work when the VBO is on a Views "Page" display. The Views module makes a second call to drupal_set_title() AFTER the views_bulk_operations_config_form() function runs, replacing the title with the title of the View.

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Issue summary: View changes
m.stenta’s picture

Update: this does not work after all. See next comment.

FYI: I was able to hack this with a custom module using the following implementation of hook_views_bulk_operations_form_alter():

/**
 * Implements hook_views_bulk_operations_form_alter().
 */
function mymodule_views_bulk_operations_form_alter(&$form, &$form_state, $vbo) {

  // If we are viewing a VBO config form, set the View title to '<none>' so that Views
  // doesn't override the page title set by VBO with drupal_set_title().
  // See https://www.drupal.org/node/2905171.
  if (!empty($form_state['step']) && $form_state['step'] == 'views_bulk_operations_config_form') {
    $vbo->view->set_title('<none>');
  }
}
m.stenta’s picture

Actually, upon further testing, the code in #3 above does not work. Well, it does - but only if you refresh the config form page itself (resubmitting form data). It does not work to fix the title on the initial page load. I was testing by refreshing the config form page so I missed that.