I just updated to 7.x-1.x-dev that was released on Dec 2, 2015.

There is a regression in here that may take some time to explain.

I have a table group where the rows are defined by time and the columns field a field named room. The table group is only rendering columns that have values for the last row in the table.

This is the data I have

                  Room 1     Room 2    Room 3
10:00am    Biology      Comp. Sci  Math
11:00am    Lunch

However, we only get the columns present in the last row so end up with

                  Room 1   
10:00am    Biology 
11:00am    Lunch

This is happening because we have the following in tablegroup_plugin_style_tablegroup.inc

       foreach ($rows as $row_header => $row) {
        // Group by column:
        $columns = $this->render_grouping($row, $opt['col_grouping']);
        $cols = array_merge($cols, array_diff(array_keys($columns), $cols));
        $table['raw'][$row_header] = $columns;
      }

so $columns is the result of render_grouping for the last row.

Then we set up the table_headers based on the values in $columns.

I fixed this by keeping a separate array of all the columns found in all the rows and then using that to create table headers.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bkat created an issue. See original summary.

C-Logemann’s picture

Status: Active » Needs review
mstrelan’s picture

Status: Needs review » Needs work

Manually applying the patch works, but it needs a reroll. Something odd about the file name at the top of the patch.

mandus.cz’s picture

Works (manual editing), but not working Preload all terms/allowed values for referenced entity.

P2790’s picture

@bkat thanks for this fix. Anyone know how to fix the patch so that it applies correctly?

antiorario’s picture

FileSize
1.24 KB

Here's a reroll of the patch, minus the spelling fixes. As tempting as it is to include spelling fixes in a functional patch, they should be fixed by opening a separate issue and patch.

kumkum29’s picture

Thanks Antiorario !

your patch solves the bug on my site.
Please insert this patch in the next version of the module...

antiorario’s picture

Status: Needs work » Needs review
Jorge Navarro’s picture

Status: Needs review » Reviewed & tested by the community

Patch #6 solves the problem.

Jej’s picture

Thanks to #6 patch!