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';
}
}
Comment | File | Size | Author |
---|---|---|---|
#2 | media_browser_plus-views_bulk_actions_broken-2209833-2-7.patch | 794 bytes | hkirsman |
#2 | Screen Shot 2016-02-04 at 20.20.49.png | 89.54 KB | hkirsman |
Comments
Comment #1
dkingofpa CreditAttribution: dkingofpa commented@tswaters Thanks! I was having the same issue and your snippet of code helped get around the problem.
Comment #2
hkirsman CreditAttribution: hkirsman commentedFix 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.
I've attached a patch from tswaters code.
Comment #3
oemer CreditAttribution: oemer at Computer Manufaktur GmbH commentedThe 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:
After reverting the view with the drush command everything worked again.