Skip to content

Commit 44c8d97

Browse files
committed
fix: avoid any actions for untranslated categories, closes #3455
1 parent c3b2842 commit 44c8d97

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

phpmyfaq/assets/templates/admin/content/category.overview.twig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,33 +74,41 @@
7474
{% endif %}
7575

7676
<div class="pmf-category-actions">
77-
<!-- Add FAQ to category (always) -->
77+
<!-- Add FAQ to category -->
78+
{% if categoryInfo[key]['id'] is not empty %}
7879
<a class="btn btn-info mb-1 mt-1"
7980
href="./faq/add/{{ categoryInfo[key]['id'] }}/{{ categoryInfo[key]['lang'] }}"
8081
title="{{ 'ad_quick_entry'|translate }}" data-bs-toggle="tooltip" data-bs-placement="top">
8182
<i aria-hidden="true" class="bi bi-indent"></i>
8283
</a>
84+
{% endif %}
8385

8486
<!-- Add subcategory (if current language) -->
87+
{% if categoryInfo[key]['id'] is not empty %}
8588
<a class="btn btn-info"
8689
href="./category/add/{{ categoryInfo[key]['id'] }}/{{ categoryInfo[key]['lang'] }}"
8790
title="{{ 'ad_quick_category'|translate }}" data-bs-toggle="tooltip" data-bs-placement="top">
8891
<i aria-hidden="true" class="bi bi-plus-square"></i>
8992
</a>
93+
{% endif %}
9094

9195
<!-- Edit category (if current language) -->
96+
{% if categoryInfo[key]['id'] is not empty %}
9297
<a class="btn btn-info"
9398
href="./category/edit/{{ categoryInfo[key]['id'] }}" title="{{ 'ad_kateg_rename'|translate }}"
9499
data-bs-toggle="tooltip" data-bs-placement="top">
95100
<i aria-hidden="true" class="bi bi-pencil"></i>
96101
</a>
102+
{% endif %}
97103

98104
<!-- Translate category -->
105+
{% if categoryInfo[key]['id'] is not empty %}
99106
<a class="btn btn-info"
100107
href="./category/translate/{{ categoryInfo[key]['id'] }}"
101108
title="{{ 'ad_categ_translate'|translate }}" data-bs-toggle="tooltip" data-bs-placement="top">
102109
<i aria-hidden="true" class="bi bi-globe"></i>
103110
</a>
111+
{% endif %}
104112

105113
<!-- Delete category (if no subcategories) -->
106114
{% if children is empty %}

0 commit comments

Comments
 (0)