Closed tobias-r closed 10 years ago
To patch this, on RequestListener (I wrote another RequestListener that extends him to do this) :
/**
* Gets the RedirectResponse by switch param.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
protected function getRedirectResponseBySwitchParam()
{
if (true === $this->isFullPath) {
$request = $this->container->get('request');
$redirectUrl = $request->getUriForPath($request->getPathInfo());
// Patch to keep queries
$queries = array();
parse_str ($request->server->get('QUERY_STRING'), $queries);
if(array_key_exists('device_view', $queries)) {
unset($queries['device_view']);
}
if(sizeof($queries) > 0) {
$redirectUrl .= '?'.http_build_query($queries);
}
// End of patch
} else {
$redirectUrl = $this->getCurrentHost();
}
return $this->deviceView->getRedirectResponseBySwitchParam($redirectUrl);
}
Hi,
if I add device_view to my URL http://xxx.com/?param=1&device_view=full the bundle redirects to http://xxx.com/, so the query string gets lost.
Could you solve this issue?
Thank you! Tobi