Commit 4e5cb3f4 authored by catch's avatar catch
Browse files

Issue #2689607 by morenstrat, Ante890: Language from URL negotiator does not...

Issue #2689607 by morenstrat, Ante890: Language from URL negotiator does not add request query to language switcher links
parent 5deeecef
......@@ -192,6 +192,7 @@ public function processOutbound($path, &$options = array(), Request $request = N
*/
public function getLanguageSwitchLinks(Request $request, $type, Url $url) {
$links = array();
$query = $request->query->all();
foreach ($this->languageManager->getNativeLanguages() as $language) {
$links[$language->getId()] = array(
......@@ -202,6 +203,7 @@ public function getLanguageSwitchLinks(Request $request, $type, Url $url) {
'title' => $language->getName(),
'language' => $language,
'attributes' => array('class' => array('language-link')),
'query' => $query,
);
}
......
......@@ -118,8 +118,9 @@ protected function doTestLanguageBlockAuthenticated($block_label) {
protected function doTestLanguageBlockAnonymous($block_label) {
$this->drupalLogout();
// Assert that the language switching block is displayed on the frontpage.
$this->drupalGet('');
// Assert that the language switching block is displayed on the frontpage
// and ensure that the active class is added when query params are present.
$this->drupalGet('', ['query' => ['foo' => 'bar']]);
$this->assertText($block_label, 'Language switcher block found.');
// Assert that only the current language is marked as active.
......
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