Closed
Description
Problem/Motivation
Node search form submissions return the same results every time. Even changing the values for keys
in the query string doesn't work as expected.
To repeat
- Submit a standard basic node keyword search.
- Note the results.
- Submit a new search with different keywords. The results are the same as for the first search.
Proposed resolution
Set $request->server
params correctly.
The problem appears to be that $_SERVER['QUERY_STRING']
doesn't contain the query string.
In \Drupal\Core\Routing\RouteProvider::getRouteCollectionForRequest()
, a cached version of the request URI without the query string (in this case, search/node
) is getting served because $request->getQueryString()
is empty:
$cid = 'route:' . $request->getPathInfo() . ':' . $request->getQueryString();
if ($cached = $this->cache->get($cid)) {
$this->currentPath->setPath($cached->data['path'], $request);
$request->query->replace($cached->data['query']);
return $cached->data['routes'];
}
Remaining tasks
Research whether ReactPHP assembles an analog to$_SERVER
.- Apply fix.
- Test.
- Submit pull request.
API changes
The interface shouldn't change, but the values available through $request->server->get()
should more accurately reflect a standard PHP server environment.