Fix for checkboxes visibility problem can be found in #21

Comments

skitten created an issue. See original summary.

Graber’s picture

Can you enter more details? Can't reproduce.. What settings and action annotation?

Graber’s picture

Oh I think I know what you mean. The "select all" checkbox is hidden since a few commits, you have to select all results using top checkbox or manually and press the button that will appear, similar as in the D7 version.

  • Graber committed 3e24d9c on 8.x-1.x
    Issue #2892453: Now select_all js is added only for table style plugin....
Graber’s picture

Status: Active » Needs review

Also may be that you've been using a different display plugin, select all was working only on tables previously. Fixed.

skitten’s picture

Updated to 3e24d9c and I still don't see it appearing. I'll dig through the code later and see if I can work out what's going on.

skitten’s picture

Status: Needs review » Active

I don't understand why yet, but:
- 479ea4d broke Select All for same page configurable actions (when I comment out the changes that force the new page form)
- Select All never seemed to work when the configuration form is on a new page (if I go back to 88c18cb and choose configuration form on new page there doesn't seem to be a way to select all.

My view is a straightforward table, so I don't think that was an issue.

Graber’s picture

@skitten a few questions:
1. Do you see any errors in browser console?
2. When you inspect HTML below the "Apply to selected items" button do you see a hidden checkbox?

Is anyone else experiencing this issue?

skitten’s picture

1. No errors
2. No hidden checkbox.

Graber’s picture

Status: Active » Postponed (maintainer needs more info)

Please provide steps to reproduce.

Graber’s picture

Please check this issue, it may be the cause of the problem.

Graber’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing after 3 months without activity.

skitten’s picture

Assigned: Unassigned » skitten
Status: Closed (cannot reproduce) » Active

Sorry - just getting around to digging into this again.

Actually I do have the hidden checkbox in the form, so my hypothesis is that there's something about my config (or theme?) that's making the javascript trickery fail.

I made a fresh view on my site and it doesn't show there either, so it's not something specific to a single view. Works fine on a clean site though (using 8.x-1.0 on both).

My javascript is weak but this gives me somewhere to start digging. This is important for our site so I'm motivated...

skitten’s picture

Figured it out; my theme is based on Bootstrap, and bootstrap's template for Views tables gives them class 'table' rather than 'views-table'. By overriding the template in my theme and adding the 'views-table' class I get the select all button to appear and work. Not sure what the correct fix for this should be.

It's still a little broken as it's not getting the string for the button.

Repo steps: Install drupal/bootstrap and set it as your default theme.

Graber’s picture

Great, we should make VBO js theme - independent as possible, although js functionality can always be broken by custom HTML from a theme.

A good solution would be adding a custom class to the view table container in the backend and using it in the js.

classes are / can be added in Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm::viewsForm().

Also adding an issue that could be related, maybe even a duplicate.

This will also need a port to 2.x

joelpittet’s picture

@skitten if bootstrap allows to inject CSS classes that we can count on it may be good to add a vbo-table class in there so we don't count on 'classy' classes.

DuneBL’s picture

I got the same problem: using bootstrap and vbo 2.x
If the vbo column containing the checkbox is the first column, then the checkbox is not visible.
But, it was not a class name problem as explained in #14 ('table' vs 'views-table'), it was a margin-left problem that I could solve by adding this css rule:

//bug bootstrap vs vbo: vbo checkbox not visible in first column
.views-field-views-bulk-operations-bulk-form .checkbox input[type="checkbox"] {
	margin-left:0;
}

note: the problem is not in vbo 1.x (I have tested twice... seems really strange)

Do you think I should add this bug in the bootstrap queue?

Graber’s picture

We'll try to make VBO theme-independent as possible by adding its own class, but I'm afraid it'll not solve all the issues as js depends on the DOM structure. Wait a bit with that Bootstrap issue please.

Graber’s picture

I uploaded a more general patch for 2.x in https://www.drupal.org/project/views_bulk_operations/issues/2932177#comm.... The solution can be backported to 1.x. In general field plugin sets a param that is read by views_table preprocess hook where a class is added.

Unfortunately I don't have any more time to split that to 2 diffrerent issues so it'll probably be in one commit with #2932177 for 2.x.

DuneBL’s picture

I have removed my #17 css fix and I have applied https://www.drupal.org/project/views_bulk_operations/issues/2932177#comm... , but unfortunately the checkbox is not visible again...
Re-applying #17 fix it

DuneBL’s picture

Taking into account the new styles vbo-table, here is an updated css patch to display the checkboxes in bootstrap theme:

//bug bootstrap vs vbo: vbo checkbox not visible id in first column
.vbo-table input[type="checkbox"] {
	margin-left:0;
}
Graber’s picture

Title: Need "select all" option for configurable actions with form on new page » VBO elements not displayed properly on various themes, esp. Bootstrap
Issue tags: +theming, +JavaScript

Ok, now we can be sure this calls for an issue on Bootstrap theme project.

Also changing title so hopefully others having similar issues will find a solution easier.

I think we'll be able to set this to "Fixed" when the new class will be committed to 2.x (soon enough)

DuneBL’s picture

I have added an issue in the bootstrap queue to add the css tweak in #21: https://www.drupal.org/project/bootstrap/issues/2944364

Graber’s picture

Status: Needs work » Fixed
Related issues: +#2944364: VBO elements not displayed properly on Bootstrap

Great, I think we did everything to solve the issue, setting this to fixed.

Thanks!

Graber’s picture

Assigned: skitten » Unassigned
Issue summary: View changes

Status: Fixed » Closed (fixed)

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