Skip to content
Snippets Groups Projects
Commit 45382d15 authored by Srishti Bankar's avatar Srishti Bankar
Browse files

Addressed feedback

parent 5198b502
No related branches found
No related tags found
No related merge requests found
......@@ -236,7 +236,7 @@ public function testContentAdminPages() {
}
/**
* Tests content admin page multilingual.
* Tests content admin page for multilingual site.
*/
public function testContentAdminPageMultilingual() {
$this->drupalLogin($this->adminUser);
......@@ -244,7 +244,7 @@ public function testContentAdminPageMultilingual() {
\Drupal::service('module_installer')->install(['language']);
ConfigurableLanguage::create([
'id' => 'es',
'label' => 'Spain',
'label' => 'Spainish',
])->save();
$this->drupalCreateNode(['type' => 'page', 'title' => 'English title'])
......
......@@ -74,7 +74,7 @@ public function getValueOptions() {
public function query() {
// Don't filter by language in case the site is not multilingual, because
// there is no point in doing so.
if (!$this->languageManager->isMultilingual() || !$this->access($this->view->getUser())) {
if (!$this->languageManager->isMultilingual()) {
return;
}
......@@ -85,8 +85,12 @@ public function query() {
* {@inheritdoc}
*/
public function access(AccountInterface $account) {
// Check if the user has access to the language filter.
return $this->languageManager->isMultilingual() && parent::access($account);
if (!parent::access($account)) {
return FALSE;
}
// The user will have access to the language filter only if the site is
// multilingual.
return $this->languageManager->isMultilingual();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment