From 58da64a78245a2c855368346467d22b8eb0a9b41 Mon Sep 17 00:00:00 2001 From: Yuri Bachkov Date: Wed, 26 Feb 2020 18:00:06 +0200 Subject: [PATCH 1/3] Fixed notice in Grid/Column/Column Fixed notice: Trying to access array offset on value of type null at Grid/Column/Column.php:531 --- Grid/Column/Column.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Grid/Column/Column.php b/Grid/Column/Column.php index 3c61a150..b0496623 100644 --- a/Grid/Column/Column.php +++ b/Grid/Column/Column.php @@ -525,6 +525,10 @@ public function setData($data) */ public function getData() { + if (!\is_array($this->data)){ + return []; + } + $result = []; $hasValue = false; @@ -685,6 +689,10 @@ public function getFilterType() public function getFilters($source) { + if (!\is_array($this->data)) { + return []; + } + $filters = []; if ($this->hasOperator($this->data['operator'])) { From 018a60d0497ff2e23461cc28d1f6e84ce22d3ee1 Mon Sep 17 00:00:00 2001 From: Yuri Bachkov Date: Wed, 23 Sep 2020 15:14:58 +0300 Subject: [PATCH 2/3] Fixed Illegal offset type at Grid/Column/Column.php:216 --- Grid/Column/Column.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Grid/Column/Column.php b/Grid/Column/Column.php index b0496623..fcab142d 100644 --- a/Grid/Column/Column.php +++ b/Grid/Column/Column.php @@ -213,7 +213,7 @@ public function renderCell($value, $row, $router) $value = is_bool($value) ? (int) $value : $value; if (array_key_exists((string) $value, $this->values)) { - $value = $this->values[$value]; + $value = $this->values[(string) $value]; } return $value; From b3de798243401cd709c7a7c43bfad83d010c3eff Mon Sep 17 00:00:00 2001 From: Yuri Bachkov Date: Wed, 31 Mar 2021 16:02:09 +0300 Subject: [PATCH 3/3] Removed Doctrine Version check - Doctrine\Common\Version is deprecated --- Grid/Column/Column.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Grid/Column/Column.php b/Grid/Column/Column.php index fcab142d..9901feb6 100644 --- a/Grid/Column/Column.php +++ b/Grid/Column/Column.php @@ -14,7 +14,6 @@ use APY\DataGridBundle\Grid\Filter; use APY\DataGridBundle\Grid\Row; -use Doctrine\Common\Version as DoctrineVersion; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; abstract class Column @@ -777,21 +776,6 @@ public function setOperators(array $operators) */ public function getOperators() { - // Issue with Doctrine - // ------------------- - // @see http://www.doctrine-project.org/jira/browse/DDC-1857 - // @see http://www.doctrine-project.org/jira/browse/DDC-1858 - if ($this->hasDQLFunction() && version_compare(DoctrineVersion::VERSION, '2.5') < 0) { - return array_intersect($this->operators, [self::OPERATOR_EQ, - self::OPERATOR_NEQ, - self::OPERATOR_LT, - self::OPERATOR_LTE, - self::OPERATOR_GT, - self::OPERATOR_GTE, - self::OPERATOR_BTW, - self::OPERATOR_BTWE, ]); - } - return $this->operators; }