Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getRowsWithoutSummaryRow when iterating over subtables #7476

Merged
merged 1 commit into from Mar 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/DataTable.php
Expand Up @@ -374,7 +374,7 @@ public function sort($functionCallback, $columnSortedBy)
usort($this->rows, $functionCallback);

if ($this->isSortRecursiveEnabled()) {
foreach ($this->getRows() as $row) {
foreach ($this->getRowsWithoutSummaryRow() as $row) {

$subTable = $row->getSubtable();
if ($subTable) {
Expand Down Expand Up @@ -487,7 +487,7 @@ public function filter($className, $parameters = array())
*/
public function filterSubtables($className, $parameters = array())
{
foreach ($this->getRows() as $row) {
foreach ($this->getRowsWithoutSummaryRow() as $row) {
$subtable = $row->getSubtable();
if ($subtable) {
$subtable->filter($className, $parameters);
Expand All @@ -508,7 +508,7 @@ public function filterSubtables($className, $parameters = array())
*/
public function queueFilterSubtables($className, $parameters = array())
{
foreach ($this->getRows() as $row) {
foreach ($this->getRowsWithoutSummaryRow() as $row) {
$subtable = $row->getSubtable();
if ($subtable) {
$subtable->queueFilter($className, $parameters);
Expand Down Expand Up @@ -1601,7 +1601,7 @@ public function walkPath($path, $missingRowColumns = false, $maxSubtableRows = 0
public function mergeSubtables($labelColumn = false, $useMetadataColumn = false)
{
$result = new DataTable();
foreach ($this->getRows() as $row) {
foreach ($this->getRowsWithoutSummaryRow() as $row) {
$subtable = $row->getSubtable();
if ($subtable !== false) {
$parentLabel = $row->getColumn('label');
Expand Down
2 changes: 1 addition & 1 deletion core/DataTable/Filter/Sort.php
Expand Up @@ -279,7 +279,7 @@ private function sort(DataTable $table, $functionCallback)
unset($sortedRows);

if ($table->isSortRecursiveEnabled()) {
foreach ($table->getRows() as $row) {
foreach ($table->getRowsWithoutSummaryRow() as $row) {

$subTable = $row->getSubtable();
if ($subTable) {
Expand Down
2 changes: 1 addition & 1 deletion core/DataTable/Filter/Truncate.php
Expand Up @@ -77,7 +77,7 @@ public function filter($table)
$table->queueFilter('ReplaceSummaryRowLabel', array($this->labelSummaryRow));

if ($this->filterRecursive) {
foreach ($table->getRows() as $row) {
foreach ($table->getRowsWithoutSummaryRow() as $row) {
if ($row->isSubtableLoaded()) {
$this->filter($row->getSubtable());
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/Actions/DataTable/Filter/Actions.php
Expand Up @@ -43,7 +43,7 @@ public function filter($table)
return urldecode($label);
}));

foreach ($table->getRows() as $row) {
foreach ($table->getRowsWithoutSummaryRow() as $row) {
$subtable = $row->getSubtable();
if ($subtable) {
$this->filter($subtable);
Expand Down
2 changes: 1 addition & 1 deletion plugins/Referrers/DataTable/Filter/UrlsFromWebsiteId.php
Expand Up @@ -36,7 +36,7 @@ public function filter($table)
}));
$table->queueFilter('ColumnCallbackReplace', array('label', 'Piwik\Plugins\Referrers\getPathFromUrl'));

foreach ($table->getRows() as $row) {
foreach ($table->getRowsWithoutSummaryRow() as $row) {
$subtable = $row->getSubtable();
if ($subtable) {
$this->filter($subtable);
Expand Down