I updated from views_bulk_operations-6.x-1.10 to views_bulk_operations-6.x-1.11. Now the selectioned rows are not passed to the confirmation step.

I.E.: I select rows # 1, 3 and 5. I fill the email fields, but in the confirmation step, the system ask me to send just rows # 3 and 5.

I also attach the view for your further investigation.
thanks in advance

CommentFileSizeAuthor
utenti_gruppi_cloned.txt126.22 KBAnonymous (not verified)

Comments

bojanz’s picture

Interesting. I am able to sometimes get the same behavior on the core VBO views as well.
My theory is that it has to do with the new AJAX selection mechanism (for every checkbox you select, an AJAX request is fired). When you click submit not all requests have completed, thus giving you an incomplete selection. You can open the Chrome dev tool or Firebug and see the requests in action.
This can easily be tested by disabling the AJAX selection, go to your style plugin settings (gear icon next to Style: Views Bulk Operations), uncheck "Preserve selection across pages", and let me know if that changes anything.

Anonymous’s picture

Title: When "Preserve selection across pages" is enabled, it is possible for a row to be dropped from the selection. » record not passed to confirmation step

I unchecked "Preserve selection across pages" and the issue has gone away. thanks a lot. Do you want me to mark this post as closed?

bojanz’s picture

Let's keep it open for now. Perhaps someone can implement a fix (if the form sent more selected items than there are in the session, use them as well).

bojanz’s picture

Title: record not passed to confirmation step » When "Preserve selection across pages" is enabled, it is possible for a row to be dropped from the selection.

Retitling.

Anonymous’s picture

Title: record not passed to confirmation step » When "Preserve selection across pages" is enabled, it is possible for a row to be dropped from the selection.
Version: 6.x-1.x-dev » 6.x-1.12

the problem is back again. I've already tried both to flag and not to flag "Preserve selection across pages" option. Ajax is deactivated.

bojanz’s picture

This is a bug that happens when "Preserve selection across pages" is on.
If you don't have it on, but have problems with dropped selection, open a new issue, cause it's probably an unrelated problem. Of course, include as much info as you can.

Anonymous’s picture

sorry, you're right. I double checked the issue the bug happens when "Preserve selection across pages" is on.

infojunkie’s picture

@giorez, the view that you attached references many third-party modules and CCK fields. Can you please reproduce the bug with only core Drupal + Views + VBO? Also specify which Views version you're working with. Thanks!

sittard’s picture

I'm using VBO 6-x-1.12 and also experiencing this issue when "Preserve selection across pages" is selected. Unfortunately my set-up includes a number of 3rd party modules and the view is fairly complex and includes CCK and taxonomy fields.

bojanz’s picture

I don't think we need additional info.

My theory is this: a heavy site takes a long time to bootstrap. So you go to a VBO view, and select 6 items fast. That's 6 AJAX requests doing a full drupal bootstrap.
By the time you've hit submit, some of them might not have completed, leading to an incomplete selection.
So VBO needs to look at the form state for the current page, and the session for all other pages.

Funksmaname’s picture

I'm getting the exact same issue - turning off "preserve selection across pages" fixed it - thanks for the info... is a fix technically possible?

infojunkie’s picture

I will definitely take a look at this as soon as I get the chance. We should start by validating bojanz' theory.

bojanz’s picture

Just closed #1326834: Preserve selection functionality silently causes failure if JS fails as duplicate.

We should always use the form state values for the first page, and the session data for all other pages.
That would fix both issues, and is a simple fix.
Who wants to provide a patch? :)

mgriego’s picture

Ah, looks like we're running into this on our site as well, and, yes, we do have a fairly heavy bootstrap, so I can absolutely see the ajax sometimes failing to complete if a user is clicking through the form too fast.

kenorb’s picture

infojunkie’s picture

Version: 6.x-1.12 » 6.x-1.x-dev

Please take a look at similar issue #1449470: Queue the select ajax calls to avoid issue in sites that takes some secconds and check if latest dev fixes it.

djdevin’s picture

That doesn't fix the issue where if you select a bunch of items, then click the VBO button quickly before they have finished queuing, you end up with dropped rows. It's really easy to reproduce if you're a power user on a site that isn't super fast.

I think the VBO buttons should be disabled with JS until the queue has finished (temporarily grayed out or something) to prevent a click before the selection has been recorded.

infojunkie’s picture

Good catch, thanks. I was able to reproduce this by inserting a sleep(5) in the views_bulk_operations_select() function which is responsible for real-time selection. I'll be working on it as time permits.

infojunkie’s picture

Priority: Normal » Major
infojunkie’s picture

Status: Active » Fixed

Fixed this in the latest dev: commit 1, commit 2, commit 3.

VBO submit buttons are disabled during a selection sync, and the standard throbber appears. Note that the Garland theme redefines button styles, so disabled buttons will not appear differently than active ones, although they do act disabled.

Please try it (12 hours from now) and let me know if it works for you.

djdevin’s picture

Fast response, thanks - I was just dumping my thoughts! I'll test this from git.

djdevin’s picture

Yep, this seems to fix it.

Also tested both modes of actions (buttons and the dropdown).

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

...