Skip to content

Commit

Permalink
PHP 7.4 warning in ColumnDelete (matomo-org#15224)
Browse files Browse the repository at this point in the history
* PHP 7.4 warning in ColumnDelete

fix matomo-org#15210

* remove tabs

* Update ColumnDelete.php

* Update ColumnDelete.php

* Update ColumnDelete.php

* Update ColumnDelete.php

* Update ColumnDelete.php
  • Loading branch information
tsteur authored and jbuget committed Sep 26, 2020
1 parent 80abd13 commit 63956ef
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/DataTable/Filter/ColumnDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,18 @@ protected function removeColumnsFromTable(&$table)
if(!$this->isArrayAccess($row)) {
continue;
}

foreach ($this->columnsToRemove as $column) {

if (!array_key_exists($column, $row)) {

if (is_array($row)) {
if (!array_key_exists($column, $row)) {
continue;
}
} elseif ($table instanceof \ArrayAccess) {
if (!$row->offsetExists($column)) {
continue;
}
}

if ($this->deleteIfZeroOnly) {
$value = $row[$column];
if ($value === false || !empty($value)) {
Expand Down

0 comments on commit 63956ef

Please sign in to comment.