diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2016-07-15 05:10:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-15 05:10:45 +0300 |
commit | 319f519555f523291fa678fbe05c0d1a2b22dec9 (patch) | |
tree | f4c8b9aaede796dce019c0a51e933a05f8813b2f | |
parent | cb9192d2ef1ae984298dec348c12e01a1e6b3ff2 (diff) |
Searching recursively in sub-tables should work as expected (#10303)
* When a datatable is manipulated in memory, the correct id subtable is stored in metadata and must be fetched from there.
-rw-r--r-- | plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig index eb237b93b9..a85ee66852 100644 --- a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig +++ b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable.twig @@ -20,6 +20,7 @@ {% else %} {%- for rowId, row in dataTable.getRows() -%} {%- set rowHasSubtable = not subtablesAreDisabled and row.getIdSubDataTable() and properties.subtable_controller_action is not null -%} + {%- set rowSubtableId = row.getMetadata('idsubdatatable_in_db')|default(row.getIdSubDataTable()) -%} {%- set isSummaryRow = rowId == constant('Piwik\\DataTable::ID_SUMMARY_ROW') -%} {%- set shouldHighlightRow = isSummaryRow and properties.highlight_summary_row -%} @@ -30,7 +31,7 @@ or not properties.replace_row_with_subtable|default(false) -%} {% if showRow %} - <tr {% if rowHasSubtable %}id="{{ row.getIdSubDataTable() }}"{% endif %} + <tr {% if rowHasSubtable %}id="{{ rowSubtableId }}"{% endif %} {% if row.getMetadata('segment') is not false %} data-segment-filter="{{ row.getMetadata('segment')|e('html_attr') }}"{% endif %} {% if row.getMetadata('url') is not false %} data-url-label="{{ row.getMetadata('url')|rawSafeDecoded }}"{% endif %} data-row-metadata="{{ row.getMetadata|json_encode|e('html_attr') }}" @@ -46,7 +47,7 @@ {# display subtable if present and showing expanded datatable #} {% if properties.show_expanded|default(false) and rowHasSubtable %} - {% include "@CoreVisualizations/_dataTableViz_htmlTable.twig" with {'dataTable': row.getSubtable(), 'idSubtable': row.getIdSubDataTable()} %} + {% include "@CoreVisualizations/_dataTableViz_htmlTable.twig" with {'dataTable': row.getSubtable(), 'idSubtable': rowSubtableId} %} {% endif %} {%- endfor -%} {% endif %} |