Skip to content
Merged
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 phpmyfaq/assets/templates/admin/user/group.twig
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
name="group_rights[]" value="{{ right.right_id }}"
class="form-check-input permission" disabled>
<label class="form-check-label" for="group_right_{{ right.right_id }}">
{{ right.name|permission }}
{{ right.name | default('') | permission }}
</label>
</div>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/assets/templates/admin/user/users.twig
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
name="user_rights[]" value="{{ right.right_id }}"
class="form-check-input permission" />
<label class="form-check-label" for="user_right_{{ right.right_id }}">
{{ right.name|default('Unknown')|permission }}
{{ right.name | default('') | permission }}
</label>
</div>
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function getFilters(): array

private function getPermissionTranslation(string $string): string
{
$translationCode = sprintf('permission::%s', $string);
return Translation::get($translationCode) ?? '';
return empty($string) ? '' : (Translation::get(sprintf('permission::%s', $string)) ?? '');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protected function setUp(): void
$this->extension = new PermissionTranslationTwigExtension();
}

public function testGetFilters()
public function testGetFilters(): void
{
$filters = $this->extension->getFilters();

Expand Down