Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dropdown_language
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
dropdown_language
Merge requests
!3
Issue
#3270979
: Wrong usage of null coealescing operator in DropdownLanguage.php
代码
评审变更
检出分支
下载
补丁
文本差异
Merged
Issue
#3270979
: Wrong usage of null coealescing operator in DropdownLanguage.php
issue/dropdown_language-3270979:3270979-wrong-usage-of
into
3.0.x
Overview
0
Commits
4
Pipelines
0
Changes
1
Merged
Joshua Sedler
requested to merge
issue/dropdown_language-3270979:3270979-wrong-usage-of
into
3.0.x
2 years ago
Overview
0
Commits
4
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
3.0.x
version 6
a28ed723
2 years ago
version 5
2a50eaa9
2 years ago
version 4
322bce79
2 years ago
version 3
fde4de68
2 years ago
version 2
8f90006f
2 years ago
version 1
f7371b03
2 years ago
3.0.x (base)
and
latest version
latest version
a28ed723
4 commits,
2 years ago
version 6
a28ed723
4 commits,
2 years ago
version 5
2a50eaa9
4 commits,
2 years ago
version 4
322bce79
3 commits,
2 years ago
version 3
fde4de68
2 commits,
2 years ago
version 2
8f90006f
2 commits,
2 years ago
version 1
f7371b03
1 commit,
2 years ago
1 file
+
2
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Plugin/Block/DropdownLanguage.php
+
2
−
1
Options
@@ -144,7 +144,8 @@ class DropdownLanguage extends BlockBase implements ContainerFactoryPluginInterf
$derivative_id
=
$this
->
getDerivativeId
();
$route
=
$this
->
pathMatcher
->
isFrontPage
()
?
'<front>'
:
'<current>'
;
$current_language
=
$this
->
languageManager
->
getCurrentLanguage
(
$derivative_id
)
->
getId
();
$links
=
$this
->
languageManager
->
getLanguageSwitchLinks
(
$derivative_id
,
Url
::
fromRoute
(
$route
))
->
links
;
$languageSwitchLinksObject
=
$this
->
languageManager
->
getLanguageSwitchLinks
(
$derivative_id
,
Url
::
fromRoute
(
$route
));
$links
=
(
$languageSwitchLinksObject
!==
NULL
)
?
$languageSwitchLinksObject
->
links
:
[];
// Place active language ontop of list.
if
(
isset
(
$links
[
$current_language
]))
{
Loading