Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit 5212c61

Browse files
Merge pull request #84 from SURFnet/fix-group-rendering
Fix group rendering
2 parents b306656 + 263d336 commit 5212c61

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div class="jscroll-inner">
2-
{% include ':groups:_groups.html.twig' with {'color': 'grey', 'type': 'results'} %}
2+
{% include ':groups:_groups.html.twig' with {'color': 'grey', 'type': 'results', 'groups': organisationGroups} %}
33
</div>

src/AppBundle/Controller/IndexController.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,19 @@ public function groupsAction(Request $request)
6868
throw new BadRequestHttpException();
6969
}
7070

71+
$groups = $this->getGroups($request->cookies, $query, $sort, $offset, $limit, $type);
72+
73+
$pluckCollection = function ($value) {
74+
if (isset($value['collection'])) {
75+
return $value['collection'];
76+
}
77+
78+
return $value;
79+
};
80+
7181
return $this->render(
7282
$this->getTemplate($type),
73-
$this->getGroups($request->cookies, $query, $sort, $offset, $limit, $type)
83+
is_null($type) ? $groups: array_map($pluckCollection, $groups)
7484
);
7585
}
7686

0 commit comments

Comments
 (0)