/**
* Shows random entry depending on the given type.
*
- * @param Entry $entry
+ * @param string $type
*
- * @Route("/{type}/random", name="random_entry", requirements={"_locale": "unread|starred|archive|untagged|all"})
+ * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|all"})
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
$bag->clear();
$bag->add('notice', 'flashes.entry.notice.no_random_entry');
- return $this->redirect($this->generateUrl('homepage'));
+ return $this->redirect($this->generateUrl($type));
}
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));