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

Commit 263d336

Browse files
Fix rendering search result by just passing the collection of groups without the sort order
1 parent 95f3564 commit 263d336

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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)