Stop passing the selection to action forms, improve performance by deferring loading all items on all pages until execution.Right now, if you do "select all on all pages" and submit the form, VBO will immediately do the query that does the select, just before displaying the config form.
It makes no sense to do such an expensive operation before both config and confirmation, since the user still has time to give up.
Instead, the loading should be done just before execution.
The action form gets the selection, which is impossible with the new approach, but it is an edge case, and not very performant if the number of selected items is very large (what is a form callback going to do with 20 thousand ids?). For those edge cases we are passing along the $view object, so the callback can assume that all items are selected (which is what VBO itself did when the form was displayed on top of the view, instead of being on its own page).
This is also important because at one stage we want to make VBO batch the selecting of the ids, so that it doesn't crash trying to load 75 thousand ids at once (my test instance), but instead loading the pages one by one in a batch.
And that can only be done if it's just before execution.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1367646-defer.patch | 4.8 KB | bojanz |
Comments
Comment #1
bojanz commentedI have this committed locally.
Won't have git access until tomorrow, pushing it then.
Comment #2
bojanz commentedPushed.