Problem/Motivation

If you insert a Bulk update field to a View, there're checkboxes at each row but the Select all checkbox missing from the table header.

Steps to reproduce

1. create a few nodes
2. install module, set up a server and index for nodes
3. create a view that lists the indexed node datasource
4. insert Bulk update field.

Proposed resolution

Make that select all checkbox available

Remaining tasks

Comments

kaszarobert created an issue. See original summary.

kaszarobert’s picture

Assigned: kaszarobert » Unassigned
Status: Active » Needs review
StatusFileSize
new1.15 KB

I attach a patch for the fix.
Drupal inserts a 'select-all' class to the table header and the core tableselect.js puts a checkbox there on page load to make it possible select all the elements in one click. This happens in core's BulkForm preRender function. SearchApiBulkForm extends this class but the SearchApiFieldTrait overrides this preRender method & that CSS class addition never happens. That overridden preRender method is called for every result row, so in the patch I check that it should only put the classname there if it is a SearchApiBulkForm we're working with.

drunken monkey’s picture

StatusFileSize
new2.52 KB
new1.4 KB

Thanks a lot for reporting this issue and providing a patch! Seems to work great, too, so very good.
(Also, sorry for taking so long to reply!)

I just cleaned up the code a bit by moving it to the actual SearchApiBulkForm class, where it belongs. Should otherwise do exactly the same. Please test/review and I’ll commit it.

kaszarobert’s picture

Status: Needs review » Reviewed & tested by the community

Everything works fine. RTBC

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Great to hear, thanks a lot for reporting back!
Committed.
Thanks again!

Status: Fixed » Closed (fixed)

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