If you set up a listener to do something when the VBO checkbox changes you'll find the incorrect value is passed to 'checked' when clicking the table row instead of the checkbox directly.

To reproduce you have 'Make the whole row clickable' enabled in your VBO settings, and have something like this in your theme JS:

$("table").on('change', '.vbo-select', function(e) {
    check = $(this).prop("checked");
    if(check) {
        alert("Checkbox is checked.");
    } else {
        alert("Checkbox is unchecked.");
    }
  });

Clicking the checkbox directly gets the correct 'is checked' alert, but clicking the row itself results in the opposite value being passed (i.e. selecting a row gets a 'checkbox is unchecked' message).

Changing one line in views_bulk_operations.js @ line 59 seems to fix it without adverse effects so far...

this.checked = checked;  // this line changed from = !checked
$(this).trigger('click');
this.checked = !checked;
});

Comments

Khalor created an issue.

joelpittet’s picture

Could you try the latest -dev release since #2608360: "Select all" checkbox works only once And maybe you'd be interested in submitting a patch for people to try out?