Problem/Motivation
Currently, the $options array that is ultimately provided to each operation/action includes basic information about the triggering view. If an operation needs to know the total number of rows in that view (e.g. for comparison with the number of rows targeted by the current action), it must re-execute the view.
Proposed resolution
Provide the total row count as an additional option in the 'view_info' sub-array. Would this be reasonable? If you prefer to keep that array is minimal as possible, that makes sense. We can always re-execute the view, but this seems like it could be a useful small addition that would save a bit of redundant processing.
Remaining tasks
Patch/review/discuss.
User interface changes
None.
API changes
API addition: actions/operations would now have quick access to the total number of rows in the view from which the bulk operation was triggered.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | views_bulk_operations-add_row_count_to_view_info-2488146-1.patch | 877 bytes | ndewhurst |
Comments
Comment #1
ndewhurst(Here's a simple patch)
Comment #2
ndewhurstComment #3
ndewhurst(here's one example use case for this: https://www.drupal.org/node/1436726#comment-9924326)