Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
file_link
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
file_link
Merge requests
!16
Issue
#3511960
: Fix type error when size is null in formatter.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3511960
: Fix type error when size is null in formatter.
issue/file_link-3511960:3511960-fix-potential-error
into
2.2.x
Overview
3
Commits
1
Pipelines
9
Changes
2
All threads resolved!
Hide all comments
Merged
Adam Nagy
requested to merge
issue/file_link-3511960:3511960-fix-potential-error
into
2.2.x
1 month ago
Overview
3
Commits
1
Pipelines
9
Changes
2
All threads resolved!
Hide all comments
Expand
Closes
#3511960
0
0
Merge request reports
Compare
2.2.x
version 8
bf47b9ef
3 weeks ago
version 7
bf47b9ef
3 weeks ago
version 6
bf47b9ef
3 weeks ago
version 5
79b6601b
3 weeks ago
version 4
326084fe
3 weeks ago
version 3
9a741d1e
3 weeks ago
version 2
8e5797d5
1 month ago
version 1
896d9349
1 month ago
2.2.x (base)
and
latest version
latest version
bf47b9ef
1 commit,
3 weeks ago
version 8
bf47b9ef
1 commit,
3 weeks ago
version 7
bf47b9ef
1 commit,
3 weeks ago
version 6
bf47b9ef
1 commit,
3 weeks ago
version 5
79b6601b
1 commit,
3 weeks ago
version 4
326084fe
1 commit,
3 weeks ago
version 3
9a741d1e
1 commit,
3 weeks ago
version 2
8e5797d5
1 commit,
1 month ago
version 1
896d9349
1 commit,
1 month ago
2 files
+
20
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/Plugin/Field/FieldFormatter/FileLinkSeparateFormatter.php
+
2
−
4
Options
@@ -30,10 +30,8 @@ class FileLinkSeparateFormatter extends LinkSeparateFormatter {
foreach
(
$items
as
$delta
=>
$item
)
{
if
(
isset
(
$element
[
$delta
]))
{
$element
[
$delta
][
'#theme'
]
=
'file_link_formatter_link_separate'
;
$element
[
$delta
]
+=
[
'#size'
=>
$this
->
getSetting
(
'format_size'
)
?
ByteSizeMarkup
::
create
(
$item
->
size
)
:
$item
->
size
,
'#format'
=>
$item
->
format
,
];
$element
[
$delta
][
'#size'
]
=
$this
->
getSetting
(
'format_size'
)
?
ByteSizeMarkup
::
create
(
$item
->
size
??
0
)
:
$item
->
size
;
$element
[
$delta
][
'#format'
]
=
$item
->
format
;
}
}
return
$element
;
Loading