Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Entity/Pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function getAssets() {
}

public function getCategory() {
return $this->getEntityKey('category');
return $this->getEntityKey('category') ?? t('default');
}

public function getDescription() {
Expand Down
4 changes: 2 additions & 2 deletions src/PatternLibraryPluginDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function setDescription($description) {
* The human-readable category of the definition.
*/
public function getCategory() {
return $this->category;
return $this->category ?? t('default');
}

/**
Expand All @@ -165,7 +165,7 @@ public function getCategory() {
* @return $this
*/
public function setCategory($category) {
$this->category = $category;
$this->category = $category ?? t('default');
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Derivative/PatternkitBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getDerivativeDefinitions($base_definition): array {
$this->derivatives[$pattern_id] = [
'category' => (string) t('Patternkit:@lib/@category', [
'@lib' => $lib ?? 'patternkit',
'@category' => $pattern->getCategory() ?? 'default',
'@category' => $pattern->getCategory() ?? t('default'),
]),
'admin_label' => t('[Patternkit] @pattern', ['@pattern' => $pattern->label()]),
'pattern' => $pattern,
Expand Down