Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Some modules such as Relation provide items as objects instead of strings. This causes the matrix not to group by that field.
Below is my data table:
When I apply the view matrix style to the table, the following is my results:
Proposed resolution
Better handling for these cases
Remaining tasks
- Come up with an approach
- Write a patch
- Manually test
Comment | File | Size | Author |
---|---|---|---|
#4 | data_table.png | 31.02 KB | mradcliffe |
#4 | example.png | 39.11 KB | mradcliffe |
Comments
Comment #2
lionguard CreditAttribution: lionguard as a volunteer commentedComment #3
lionguard CreditAttribution: lionguard as a volunteer commentedLooks like it was a bug after all with Relation-based fields (https://www.drupal.org/project/relation)
Adding the following code to Line 91 of views_matrix.theme.inc fixed it for me, but I haven't tested to see if it creates issues elsewhere:
Specifically, after:
I added this quick hack:
And here is the code that comes right after it:
Comment #4
mradcliffeAh, good catch. That approach (or something similar) seems sensible. I probably won't be able to get to a patch for a bit, but I want to take a closer look at it.
I changed the title a bit to reflect handling.