When I select a few nodes in page 1 and then click page 2, the selection on page 1 is lost. That's annoying and counter-intuitive.

Comments

jpmckinney’s picture

Component: Code » Core

Subscribing.

anrikun’s picture

Subscribing.

bschilt’s picture

This issue came up for me as well.

Christopher Herberte’s picture

subscribing, critical bug?

Bilmar’s picture

subscribing

infojunkie’s picture

If anyone has a suggested approach on how to fix this, I'd love to hear it.

pepe roni’s picture

No problem for me. I changed the filters in views to remember the settings and all works well!

infojunkie’s picture

This issue is not about the filters, but about the selected nodes in the view.

pepe roni’s picture

Perhaps I'm missing something: if I page through the list I can page forward and backwards without loosing the selection (a feature of the view). If I modify any item, it may be positioned somewhere else in the list (as far as I modified any attribute used as sorting criteria, e.g. "last updated date").

So, can you please explain your problem that a non-native English speaking person can understand it?

infojunkie’s picture

@druppi:

* Make sure you have more than 20 nodes
* Open /admin/content/node2
* Select the first nodeby checking its checkbox
* Click 'next' on the pager => page 2 opens
* Click 'previous' on the pager => page 1 opens
=> The first node's checkbox is no longer checked.

pepe roni’s picture

Ahh, you mean the check marks. But with the normal admin/content/node you have the same behaviour!

But with your module you have the opportunity to define the number of items per page in the view and thus reduce the need to page through the list.

If it was possible to keep the check marks across pages, how long would you think they should be kept? And where should the information be saved? I could imagine a per-user table to keep the check marks, two actions to remember/forget the check marks and a tab "checked" (a sub view created by VBO automatically, with no limit in items per page) to handle the checked lines only:

  • First check the nodes to operate on and issue an action "remember ckecked items". Then you can page through the list and mark all lines as desired successively.
  • then you can click the "checked" tab to filter the nodes by "checked"
  • then execute the desired action on these nodes
  • then you could reset the check marks on the current page (i.e. all checked nodes) by executing the function "forget the checked items"

You obviously need two actions "remember" and "forget" as both operate on checked lines. The first can only add items to the internal list, the second can only remove items from the list. The most important advantage of this approach is: you can build the list of checked items successively, with different filter criteria and proceed on them with one single action!

This is a suggestion only!

Christopher Herberte’s picture

Store selection in session variable, clear all on submit or logout.

infojunkie’s picture

@Chris Heberte: the problem is that pagination is done via GET HTTP calls, so a user will select a few nodes on the current page, then click page 2, which will GET the next page without sending the current page's selection (which is on the browser form and nowhere else). Nothing will reach the backend to be saved in a session variable.

lostchord’s picture

Well maybe make the 'previous', 'next, etc elements submit buttons and have the backend work out what to do based on the button that was clicked. State can then be managed in a variety of ways.

cheers

anrikun’s picture

I suggest the selection is saved using a cookie.

infojunkie’s picture

Thanks everyone for your suggestions. I'll try them when I start implementing this.

fatstar415’s picture

subscribing

gravisrs’s picture

Hi,

I've found kind of business logic workaround for this issue - use flag module for selecting nodes.

If we want to have a cross-pager selections we can just flag nodes (ajax button - see flag module documentation) and then display on separate view all flagged nodes where users can perform a vbo action there.

It's quite easy to write a piece of jscript that will automatically update some other ajax view - during flagging a node (to display live result of flagged items).

[edit]

but anyway /subscribing for this functionality to be implemented in VBO directly

bschilt’s picture

@infojunkie, any status on this issue? Have you had time to put some code together? I'm going to need a solution within the next couple of months so if you haven't made any headway, I can take over. Or we can collaborate if you've already started.

infojunkie’s picture

Category: bug » feature

@bschilt: I can use all the help I can get frankly. So feel free to go ahead and I will gladly support your effort.

In VBO 1.10, you will find some (untested) support code for this feature:

* In views_bulk_operations.js, we now hook on $('ul.pager a').click to notify VBO (via AJAX) that a pager link has been clicked. The URL used is views-bulk-operations/js/pager and the current selection is passed as argument.
* In views_bulk_operations.module, hook_menu responds to the AJAX call above by invoking views_bulk_operations_pager which does nothing but set some variables in $_SESSION.

What's missing is to put all this together in views_bulk_operations_form_submit. Right now, this function retrieves the selected objects from $form_state['storage'][VIEWS_BULK_OPS_STEP_VIEW]['objects']['selection'] which only contains the selection from the page where the user clicked "Submit". This selection should be merged with the selections made in previous pages and that are stored in $_SESSION inside the views_bulk_operations_pager function as explained above.

Hope this is clear! Thanks for your help :-)

anrikun’s picture

That sounds good! I'm looking forward to this feature!

bschilt’s picture

@infojunkie - My client doesn't want me to work on this issue quite yet. This doesn't rank high enough on their task list so my support will have to wait. Its still on my clients todo list, so I'll probably be able to get to it in the near future.

maria_zk’s picture

+1 For this feature. Any ideas on how to save the selection in Glossary views as well?

ducdebreme’s picture

subscribing

lsancheztapia’s picture

subscribing

pepe roni’s picture

You should keep in mind that any feature accessible via js must also be accessible without js for user accessibility. Js must be used for comfort reasons only.

kirsta’s picture

I work with clients that are looking for this feature, and will pay a developer. Would love to find somebody who's been working with this ... msg me at kstapelfeldt@upei.ca if you're interested, or know somebody who is!

infojunkie’s picture

Status: Active » Fixed

Fixed in the latest dev (CVS commit #483052). Please try it (12 hours from now) and let me know if it works for you!

Thanks to the Islandora project at UPEI's Robertson Library for sponsoring this fix.

Re #26: I've made sure to gracefully degrade to single-page selection in case of no JS.

Status: Fixed » Closed (fixed)

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

Makku01’s picture

I just tried this, in VBO 6.x-1.13. The selections are not preserved across pages. I use Views 6.x 3.0.

makbul_khan8’s picture

subscribing