Split off from #342378: Bulk operations operates on all nodes in nodes table when select all nodes in view is chosen .. The 'select all rows in this view' doesn't work with faceted views
To reproduce:
1) Create a view with some operations (best to test is of course the delete action)
2) Create a faceted view, select the default view you created in 1 and add a block where you can select on content types.
3) Create 2 content types (page & story by default) and generate some content (devel generate!)
4) Select one content type, push select all and then the 'select all rows in this view' - you need paging of course ..
5) The confirm form will show more nodes than actually needed
The argument created by faceted, in this case something like 'content_type:page' seems to be ignored.
Possible solutions:
1) create an option to hide the 'select all rows' - a bit like the other 'select all' option which you can hide.
2) fix the actual problem :) The key function here is _views_bulk_operations_adjust_selection() which also should use arguments I think
I'll investigate number 2 some more this week and add a patch for 1 somewhere this evening.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | adjust_selection-519692.patch | 1000 bytes | cfennell |
| #3 | adjust_selection-519692.patch | 986 bytes | cfennell |
Comments
Comment #1
infojunkieThanks for you report and your willingness to provide a fix.
Stupid question: how to create a faceted view?
Comment #2
swentel commented@kratib
You need to install the faceted search module (drupal.org/project/faceted_search). It comes with a lot of submodules. You at least need to enable the faceted search views and content type facets module. Than you need to create an environment at admin/settings/faceted_search and enable the content type facets block. As display style, select a view. I created a view which simply displayed results without any filters. After that, you'll have to go to the block settings page and enable the guided search block. If all went well, create more than 50 nodes (or depending on the rows chosen in the view of course), go to the url you entered in the faceted view and try to select and delete for instance ..
pfiew, hope this makes sense a bit .. :)
Comment #3
cfennell commentedI ran into this problem with an OG view - the nid was not being passed to the view in
_views_bulk_operations_adjust_selection(&$objects, $exposed_input, $plugin). The attached cured the problem for my purposes, although I'm not sure if I needed to sanitize the args at this point but did so just in case. Hope this helps a little.Great module, BTW.
Comment #4
cfennell commentedRe-rolled patch to fix a couple of dufusy errors. Not sure if this is the best way of handling the arguments problem, I'm just trying to work around it until it gets fixed. Thanks.
Comment #5
infojunkieThanks libsys for your patch! I'll try it.
@swentel: please test the patch and let us know if it fixes your problem.
Comment #6
swentel commented@kratib, I have lots of time next week at the Drupalcon, I'm going to test that out and report back! (sorry about the real delay on my part, been real busy times around here)
Comment #7
infojunkieI have added argument support to the latest dev release of VBO. Someone please try it against faceted views.
Comment #8
Pasi commentedMy 'Select all rows in this view' doesn't work at all. It always selects zero rows.
I am using the latest versions of my modules (VBO (1.8 & dev) , Views and OG...)
Quick fix would be to create an option to hide the 'select all rows', but actual fix would be nice of course :)
Comment #9
infojunkie@Pasi: do you mean with faceted views or in general? If it's the latter then please check out #361871: VBO loses selection with caching module and re-activate it if this is your case.
Comment #10
infojunkieFixed unless I hear back from OP.