Problem
I don't know how other people use this module, but probably in the majority of cases there will only be a single Views result row in each table cell, right? However, currently, all result rows that share the same values for both the column and row header fields will naturally end up in the same table cell.
We now ran into a problem when creating a highly generic matrix view where there were sometimes duplicate values according to the column and row header fields, where we only wanted to include the first encountered result (easy to control with the Views sorts).
Proposed solution
Add an option "Limit to one result per table cell" to the Matrix settings. If that is enabled, just skip all results for a table cell after the first.
This actually requires just a few lines (three, actually, excluding the form/options code) but, I think, could also be useful for other people hitting this problem. Of course, excluding results with filters is preferable performance-wise, but I think this is small enough to include for those cases where this is not possible.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2673126-2--eliminate_duplicates.patch | 2.78 KB | drunken monkey |
Comments
Comment #2
drunken monkeyPatch attached, please tell me what you think!
Comment #3
herd45 CreditAttribution: herd45 as a volunteer commentedI've tested #2 and it works as expected
Comment #5
drunken monkeyCommitted.