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 4 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_object($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.

@sgiehl I reckon it's not working maybe because we need to use indeed isset() or so as in the row object it might not have the property...
wondering if we even need this code at all as maybe unset would do the work anyway no matter if the property/key is set?

Copy link
Member Author

Choose a reason for hiding this comment

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

We couldn't remove it actually.

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

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