Skip to content
Snippets Groups Projects
Commit 3dbd80d9 authored by churel's avatar churel Committed by Stephen Lucero
Browse files

Issue #3345356 by churel, slucero: getSchema is not able to fetch asset when schema is empty

parent 495dbd22
Branches
Tags
1 merge request!65Issue #3345356: getSchema is not able to fetch asset when schema is empty
......@@ -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 {
$schema = $this->get('schema');
if (!isset($schema)) {
$item = $this->get('schema')->first();
if (empty($item)) {
$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 {
$template = $this->get('template');
if (!isset($template)) {
$item = $this->get('template')->first();
if (empty($item)) {
$this->fetchAssets();
}
$item = $this->get('template')->first();
}
return $item ? $item->getValue()['value'] : '';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment