With both 'admin_views' and 'media_browser_plus' enabled and the "Use Media Browser Plus thumbnails view as default." set to true, any bulk operations added to the file view (now at 'admin/content/file/list') do not work. The form element is still pointing at 'admin/content/file' and, as such, the user is directed back to the media browser and any items they selected for bulk operation are lost. Curiously, if ajax is enabled, any of the exposed filters do seem to work -- it's only bulk operations that appear to fail.

I was able to fix this by implementing hook_views_default_views_alter and setting 'override_path', e.g. :

/**
 * Implements hook_views_default_views_alter
 * Ensure the admin_views_file view's path is pointing at the right location
 */
function media_browser_plus_views_default_views_alter(&$views) {
  if (array_key_exists('admin_views_file', $views)
       && variable_get('media_browser_plus_thumbnails_as_default_browser', TRUE)) {
    $views['admin_views_file']->override_path = 'admin/content/file/list';
  }
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dkingofpa’s picture

@tswaters Thanks! I was having the same issue and your snippet of code helped get around the problem.

hkirsman’s picture

Fix worked! Had the same problem. When on admin/content/file/list and trying to bulk delete files it would just redirect to admin/content/file . See screenshot.

screenshot

I've attached a patch from tswaters code.

oemer’s picture

The patch used to work for me. But after updating the module admin_views to 7.x-1.6 the problem is back again.

Update: I found this note on the admin_views module page:

*Note: If you are upgrading from an older version of Administration views and the default views have been overridden (saved in the database) you could encounter issues or not see any new changes unless you revert these views, so the default in-code views are used. This can be done in the views UI listing or using drush (drush cter views_view --module=admin_views)

After reverting the view with the drush command everything worked again.