Problem/Motivation

Seems to be the exact same problem as issue #2372173 ... Views Aggregator column action seems to work for the full dataset of a view, using fixed filters, but does not respect the current results of the view with exposed filters in use.

Steps to reproduce

  • Create a view using Views Aggregator table with aggregation options; base the aggregation on all results and/or don't use a pager.
  • Set up a field with a 'column action' that'll be easy to read as it changes, such as Sum on a node ID field.
  • Set up an exposed filter field, such as content type.
  • Observe the table with all results; take note of the column action (e.g. Sum) value.
  • Use the exposed filter to change the results list; note that the results change, but the column action value does not.
  • Change the 'exposed' filter to a non-exposed one, set it to the value that you chose before. Notice that the column action value will now be set appropriately to the currently viewed results.

Proposed resolution

Whatever was done in D7 for issue #2372173 , hopefully.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

TLWatson created an issue. See original summary.

tlwatson’s picture

Rewrote the patch from #2372173 for 2.0.x version. I couldn't quite take the simplified route that was done in 7.x upstream, because the view rendering did not respect exposed filters just being "not exposed" anymore; the user inputs weren't actually in those filters' values.

The approach I did was to cycle through all the filters, look for provided exposed filter values, and implement them. I don't promise it to be foolproof since there isn't any standard sort of "setValue" method, we're just toying with arrays; but for my purposes it works for references and text (direct assignment of ['value']), and dates (if ['value'] is array, set ['value']['value']). Hopefully there is a more foolproof way out there to assign values.

tlwatson’s picture

Status: Active » Needs review
tr’s picture

Version: 2.0.x-dev » 2.1.x-dev
tr’s picture

Issue tags: +Needs tests

Created a MR to this can be tested. Also moved to the current branch, which is 2.1.x.

I think this needs a test case.

tr’s picture

Also, this seems very similar to #3447012: Does not work with data aggregation + paging? How are they different, and will the patch here fix that issue too?

tr’s picture

tr’s picture

Status: Needs review » Postponed (maintainer needs more info)