Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
patternkit
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
patternkit
Commits
3dbd80d9
Commit
3dbd80d9
authored
Mar 13, 2023
by
churel
Committed by
Stephen Lucero
Mar 13, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3345356
by churel, slucero: getSchema is not able to fetch asset when schema is empty
parent
495dbd22
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!65
Issue #3345356: getSchema is not able to fetch asset when schema is empty
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Entity/Pattern.php
+7
-7
7 additions, 7 deletions
src/Entity/Pattern.php
with
7 additions
and
7 deletions
src/Entity/Pattern.php
+
7
−
7
View file @
3dbd80d9
...
...
@@ -193,7 +193,7 @@ class Pattern extends ContentEntityBase implements PatternInterface {
*/
public
function
getHash
():
string
{
$item
=
$this
->
get
(
'hash'
)
->
first
();
return
isset
(
$item
)
?
$item
->
getValue
()[
'value'
]
:
$this
->
computeHash
();
return
$item
?
$item
->
getValue
()[
'value'
]
:
$this
->
computeHash
();
}
/**
...
...
@@ -228,11 +228,11 @@ class Pattern extends ContentEntityBase implements PatternInterface {
* {@inheritdoc}
*/
public
function
getSchema
():
string
{
$
sch
em
a
=
$this
->
get
(
'schema'
);
if
(
!
isset
(
$sch
em
a
))
{
$
it
em
=
$this
->
get
(
'schema'
)
->
first
()
;
if
(
empty
(
$it
em
))
{
$this
->
fetchAssets
();
}
$item
=
$this
->
get
(
'schema'
)
->
first
();
}
return
$item
?
$item
->
getValue
()[
'value'
]
:
''
;
}
...
...
@@ -240,11 +240,11 @@ class Pattern extends ContentEntityBase implements PatternInterface {
* {@inheritdoc}
*/
public
function
getTemplate
():
string
{
$tem
plate
=
$this
->
get
(
'template'
);
if
(
!
isset
(
$tem
plate
))
{
$
i
tem
=
$this
->
get
(
'template'
)
->
first
()
;
if
(
empty
(
$
i
tem
))
{
$this
->
fetchAssets
();
}
$item
=
$this
->
get
(
'template'
)
->
first
();
}
return
$item
?
$item
->
getValue
()[
'value'
]
:
''
;
}
...
...
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