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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Status: Active » Needs review
FileSize
2.78 KB

Patch attached, please tell me what you think!

herd45’s picture

I've tested #2 and it works as expected

  • drunken monkey committed d5e7f40 on 7.x-1.x
    Issue #2673126 by drunken monkey: Added an option to remove "duplicates...
drunken monkey’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.