Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
c16858ee
Commit
c16858ee
authored
Apr 19, 2018
by
Darron Park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix media type setting's logical problem
parent
1eacf7a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Setting.php
Modules/Setting/Entities/Setting.php
+2
-2
Settings.php
Modules/Setting/Support/Settings.php
+1
-1
No files found.
Modules/Setting/Entities/Setting.php
View file @
c16858ee
...
...
@@ -14,9 +14,9 @@ class Setting extends Model
protected
$fillable
=
[
'name'
,
'value'
,
'description'
,
'isTranslatable'
,
'plainValue'
];
protected
$table
=
'setting__settings'
;
public
function
ha
sMedia
()
:
bool
public
function
i
sMedia
()
:
bool
{
$value
=
json_decode
(
$this
->
plainValue
,
true
);
return
is_array
(
$value
)
&&
isset
(
$value
[
'media_single'
])
&&
$setting
->
files
->
count
()
;
return
is_array
(
$value
)
&&
isset
(
$value
[
'media_single'
]);
}
}
Modules/Setting/Support/Settings.php
View file @
c16858ee
...
...
@@ -36,7 +36,7 @@ class Settings implements Setting
return
is_null
(
$default
)
?
$defaultFromConfig
:
$default
;
}
if
(
$setting
->
hasMedia
()
&&
$media
=
$setting
->
files
->
first
())
{
if
(
$setting
->
isMedia
()
&&
$media
=
$setting
->
files
()
->
first
())
{
return
$media
->
path
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment