Skip to content

Commit

Permalink
BUGFIX: Saving data to cache can cause problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaDafinser committed Jan 29, 2014
1 parent eab6dd1 commit c9a9ea5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ZfcDatagrid/Datagrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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?');
}
}

/*
Expand Down

0 comments on commit c9a9ea5

Please sign in to comment.