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.

Comments

ndewhurst’s picture

(Here's a simple patch)

ndewhurst’s picture

Assigned: ndewhurst » Unassigned
Status: Needs work » Needs review
ndewhurst’s picture

(here's one example use case for this: https://www.drupal.org/node/1436726#comment-9924326)