Select all rows fails when using faceted views

swentel - July 15, 2009 - 07:13
Project:Views Bulk Operations (VBO)
Version:6.x-1.x-dev
Component:Core
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Issue tags:OG, vbo, views
Description

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.

#1

kratib - July 15, 2009 - 14:44

Thanks for you report and your willingness to provide a fix.
Stupid question: how to create a faceted view?

#2

swentel - July 15, 2009 - 17:17

@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 .. :)

#3

libsys - August 26, 2009 - 17:46
Status:active» needs review

I 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.

AttachmentSize
adjust_selection-519692.patch 986 bytes

#4

libsys - August 26, 2009 - 19:36

Re-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.

AttachmentSize
adjust_selection-519692.patch 1000 bytes

#5

kratib - August 26, 2009 - 20:31

Thanks libsys for your patch! I'll try it.

@swentel: please test the patch and let us know if it fixes your problem.

#6

swentel - August 26, 2009 - 22:02

@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)

#7

kratib - October 8, 2009 - 03:21
Component:Code» Core

I have added argument support to the latest dev release of VBO. Someone please try it against faceted views.

#8

Pasi - October 19, 2009 - 08:47

My '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 :)

#9

kratib - October 19, 2009 - 14:14

@Pasi: do you mean with faceted views or in general? If it's the latter then please check out #361871: Selection lost when going to confirmation/configuration page and re-activate it if this is your case.

#10

kratib - November 10, 2009 - 20:03
Status:needs review» fixed

Fixed unless I hear back from OP.

#11

System Message - November 24, 2009 - 20:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.