diff --git a/src/ZfcDatagrid/Column/Action/AbstractAction.php b/src/ZfcDatagrid/Column/Action/AbstractAction.php index 2c85a79a..ac7ae868 100644 --- a/src/ZfcDatagrid/Column/Action/AbstractAction.php +++ b/src/ZfcDatagrid/Column/Action/AbstractAction.php @@ -298,7 +298,7 @@ public function isDisplayed(array $row) if (isset($row[$rule['column']->getUniqueId()])) { $value = $row[$rule['column']->getUniqueId()]; } - + if ($rule['value'] instanceof AbstractColumn) { if (isset($row[$rule['value']->getUniqueId()])) { $ruleValue = $row[$rule['value']->getUniqueId()]; diff --git a/src/ZfcDatagrid/PrepareData.php b/src/ZfcDatagrid/PrepareData.php index a5bd265e..b87866dc 100644 --- a/src/ZfcDatagrid/PrepareData.php +++ b/src/ZfcDatagrid/PrepareData.php @@ -141,6 +141,8 @@ public function prepare() $data = $this->data; foreach ($data as $key => &$row) { + $row = (array) $row; + $ids = []; foreach ($this->getColumns() as $col) { @@ -224,7 +226,7 @@ public function prepare() */ if ($col->hasFormatters() === true) { foreach ($col->getFormatters() as $formatter) { - $formatter->setRowData((array) $row); + $formatter->setRowData($row); $formatter->setRendererName($this->getRendererName()); $row[$col->getUniqueId()] = $formatter->format($col); diff --git a/tests/ZfcDatagridTest/Column/Action/AbstractActionTest.php b/tests/ZfcDatagridTest/Column/Action/AbstractActionTest.php index be020a9f..04ccce0d 100644 --- a/tests/ZfcDatagridTest/Column/Action/AbstractActionTest.php +++ b/tests/ZfcDatagridTest/Column/Action/AbstractActionTest.php @@ -226,7 +226,7 @@ public function testIsDisplayedException() $this->column->getUniqueId() => '32', ]); } - + public function testIsDisplayedByColumn() { /* @var $action \ZfcDatagrid\Column\Action\AbstractAction */ @@ -238,8 +238,8 @@ public function testIsDisplayedByColumn() $action->addShowOnValue($this->column, $columnCompare, Filter::GREATER_EQUAL); $this->assertEquals([ [ - 'column' => $this->column, - 'value' => $columnCompare, + 'column' => $this->column, + 'value' => $columnCompare, 'comparison' => Filter::GREATER_EQUAL, ], ], $action->getShowOnValues());