Commit efb62290 authored by M Parker's avatar M Parker

Respect Tablefield's "Hide table header row" field setting.

parent 83df3cec
......@@ -228,6 +228,14 @@ function d3_sankey_table_group_pp_field_formatter_view($entity_type, $entity, $f
// the table grouping preprocessor.
if ($display['type'] === 'tablefield_d3_sankey_table_group_pp') {
foreach ($items as $delta => $item) {
// For convenience / clarity, make a copy of the rows we are to display.
// Then, if the field settings say to hide the first row, unset it from
// our copy.
$rows = $item['tabledata'];
if ($field['settings']['hide_headers']) {
unset($rows[0]);
}
// Apply the formatter settings to the chart.
$chart = array(
'sankeyType' => (string) $settings['sankeyType'],
......@@ -267,7 +275,7 @@ function d3_sankey_table_group_pp_field_formatter_view($entity_type, $entity, $f
// Initialize a GroupingPreprocessor, feed it the query results, get the
// raw data out of the preprocessor, and add it to the chart.
$preprocessor = new TableGroupingPreprocessor();
foreach ($item['tabledata'] as $row) {
foreach ($rows as $row) {
$preprocessor->ingestRow((array) $row);
}
$raw_data = $preprocessor->getRawData();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment