diff --git a/src/ZfcDatagrid/Datagrid.php b/src/ZfcDatagrid/Datagrid.php index 77edc2fc..00c41aa1 100644 --- a/src/ZfcDatagrid/Datagrid.php +++ b/src/ZfcDatagrid/Datagrid.php @@ -1009,10 +1009,13 @@ public function loadData() $cacheData = array( 'sortConditions' => $renderer->getSortConditions(), 'filters' => $renderer->getFilters(), - 'currentPage' => $this->getPaginator()->getCurrentPageNumber(), - 'data' => $this->getDataSource()->getData() + 'currentPage' => $this->getPaginator()->getCurrentPageNumber() ); $success = $this->getCache()->setItem($this->getCacheId(), $cacheData); + if ($success !== true) { + $options = $this->getCache()->getOptions(); + throw new \Exception('Could not save the datagrid cache. Does the directory "' . $options->getCacheDir() . '" exists and is writeable?'); + } } /*