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

PHP 7.4 warning in ColumnDelete #15224

Merged
merged 7 commits into from
Dec 11, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions core/DataTable/Filter/ColumnDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,15 @@ protected function removeColumnsFromTable(&$table)
continue;
}
foreach ($this->columnsToRemove as $column) {

if (!array_key_exists($column, $row)) {
continue;
if (is_array($row )) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like there is a space too much here:

Suggested change
if (is_array($row )) {
if (is_array($row)) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed @Findus23

if (!array_key_exists($column, $row)) {
continue;
}
} else {
if (!property_exists($row, $column)) {
continue;
}
}

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