Commit 4cff4e27 authored by alexpott's avatar alexpott

Issue #2746761 by gabesullice, Wim Leers: QueryArgsCacheContext does not support nested parameters

parent 587c514d
...@@ -29,7 +29,10 @@ public function getContext($query_arg = NULL) { ...@@ -29,7 +29,10 @@ public function getContext($query_arg = NULL) {
} }
elseif ($this->requestStack->getCurrentRequest()->query->has($query_arg)) { elseif ($this->requestStack->getCurrentRequest()->query->has($query_arg)) {
$value = $this->requestStack->getCurrentRequest()->query->get($query_arg); $value = $this->requestStack->getCurrentRequest()->query->get($query_arg);
if ($value !== '') { if (is_array($value)) {
return http_build_query($value);
}
elseif ($value !== '') {
return $value; return $value;
} }
else { else {
......
...@@ -40,6 +40,9 @@ public function providerTestGetContext() { ...@@ -40,6 +40,9 @@ public function providerTestGetContext() {
[['llama' => 'rocks', 'alpaca' => '', 'panda' => 'drools', 'z' => '0'], 'panda', 'drools'], [['llama' => 'rocks', 'alpaca' => '', 'panda' => 'drools', 'z' => '0'], 'panda', 'drools'],
[['llama' => 'rocks', 'alpaca' => '', 'panda' => 'drools', 'z' => '0'], 'z', '0'], [['llama' => 'rocks', 'alpaca' => '', 'panda' => 'drools', 'z' => '0'], 'z', '0'],
[['llama' => 'rocks', 'alpaca' => '', 'panda' => 'drools', 'z' => '0'], 'chicken', NULL], [['llama' => 'rocks', 'alpaca' => '', 'panda' => 'drools', 'z' => '0'], 'chicken', NULL],
[['llama' => ['rocks', 'kitty']], 'llama', '0=rocks&1=kitty'],
[['llama' => ['rocks' => 'fuzzball', 'monkey' => 'patch']], 'llama', 'rocks=fuzzball&monkey=patch'],
[['llama' => ['rocks' => ['nested', 'bonobo']]], 'llama', 'rocks%5B0%5D=nested&rocks%5B1%5D=bonobo'],
]; ];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment