diff --git a/Grid/Column/Column.php b/Grid/Column/Column.php index 3c61a150..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 @@ -213,7 +212,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; @@ -525,6 +524,10 @@ public function setData($data) */ public function getData() { + if (!\is_array($this->data)){ + return []; + } + $result = []; $hasValue = false; @@ -685,6 +688,10 @@ public function getFilterType() public function getFilters($source) { + if (!\is_array($this->data)) { + return []; + } + $filters = []; if ($this->hasOperator($this->data['operator'])) { @@ -769,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; }