mirror of https://github.com/MISP/MISP
fix: fixed pagination issues with the taxonomy view, fixes #1660
parent
abd288d842
commit
d26cebd8c6
|
@ -46,11 +46,15 @@ class TaxonomiesController extends AppController {
|
|||
App::uses('CustomPaginationTool', 'Tools');
|
||||
$filter = isset($this->passedArgs['filter']) ? $this->passedArgs['filter'] : false;
|
||||
$taxonomy = $this->Taxonomy->getTaxonomy($id, array('full' => true, 'filter' => $filter));
|
||||
foreach ($taxonomy['entries'] as $key => $value) {
|
||||
$taxonomy['entries'][$key]['events'] = count($value['existing_tag']['EventTag']);
|
||||
}
|
||||
$this->set('filter', $filter);
|
||||
if (empty($taxonomy)) throw new NotFoundException('Taxonomy not found.');
|
||||
$customPagination = new CustomPaginationTool();
|
||||
$params = $customPagination->createPaginationRules($taxonomy['entries'], $this->passedArgs, 'TaxonomyEntry');
|
||||
$this->params->params['paging'] = array($this->modelClass => $params);
|
||||
$params = $customPagination->applyRulesOnArray($taxonomy['entries'], $params, 'taxonomies');
|
||||
$customPagination->truncateByPagination($taxonomy['entries'], $params);
|
||||
$this->set('entries', $taxonomy['entries']);
|
||||
$this->set('urlparams', $urlparams);
|
||||
|
|
Loading…
Reference in New Issue