Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
45382d15
Commit
45382d15
authored
1 year ago
by
Srishti Bankar
Browse files
Options
Downloads
Patches
Plain Diff
Addressed feedback
parent
5198b502
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/node/tests/src/Functional/NodeAdminTest.php
+2
-2
2 additions, 2 deletions
core/modules/node/tests/src/Functional/NodeAdminTest.php
core/modules/views/src/Plugin/views/filter/LanguageFilter.php
+7
-3
7 additions, 3 deletions
.../modules/views/src/Plugin/views/filter/LanguageFilter.php
with
9 additions
and
5 deletions
core/modules/node/tests/src/Functional/NodeAdminTest.php
+
2
−
2
View file @
45382d15
...
...
@@ -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'
=>
'Spain
ish
'
,
])
->
save
();
$this
->
drupalCreateNode
([
'type'
=>
'page'
,
'title'
=>
'English title'
])
...
...
This diff is collapsed.
Click to expand it.
core/modules/views/src/Plugin/views/filter/LanguageFilter.php
+
7
−
3
View file @
45382d15
...
...
@@ -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
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment