Skip to content

Commit 8c998fc

Browse files
committed
Merge branch '4.0' into 'main'
2 parents ab3583c + bb44ce1 commit 8c998fc

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

phpmyfaq/assets/templates/admin/content/open-questions.twig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
<tr>
3131
<td>
3232
<label>
33-
<input id="questions[]" name="questions[]" value="{{ question.id }}" type="checkbox">
33+
<input id="questions[]" name="questions[]" value="{{ question.id }}" type="checkbox"
34+
class="form-check-input">
3435
</label>
3536
</td>
3637
<td>

phpmyfaq/assets/templates/default/open-questions.twig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@
2525
{{ msg2answerFAQ }}
2626
</a>
2727
</td>
28-
{% else %}
28+
{% elseif userHasPermissionToAnswer %}
2929
<td class="text-end">
3030
<a class="btn btn-primary" href="?action=add&question={{ question.id }}&cat={{ question.categoryId }}">
3131
{{ msg2answer }}
3232
</a>
3333
</td>
34+
{% else %}
35+
<td class="text-end"></td>
3436
{% endif %}
3537
</tr>
3638
{% endfor %}
37-
<tr class="pmf-open-questions">
38-
39-
</tr>
4039
{% else %}
4140
<tr>
4241
<td colspan="3">{{ msgNoQuestionsAvailable }}</td>

phpmyfaq/open-questions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
use phpMyFAQ\Category;
19+
use phpMyFAQ\Enums\PermissionType;
1920
use phpMyFAQ\Helper\QuestionHelper;
2021
use phpMyFAQ\Template\TwigWrapper;
2122
use phpMyFAQ\Translation;
@@ -51,6 +52,7 @@
5152
'msgQuestion2' => Translation::get('msgQuestion2'),
5253
'openQuestions' => $questionHelper->getOpenQuestions(),
5354
'isCloseQuestionEnabled' => $faqConfig->get('records.enableCloseQuestion'),
55+
'userHasPermissionToAnswer' => $user->perm->hasPermission($user->getUserId(), PermissionType::FAQ_ADD->value),
5456
'msgQuestionsWaiting' => Translation::get('msgQuestionsWaiting'),
5557
'msgNoQuestionsAvailable' => Translation::get('msgNoQuestionsAvailable'),
5658
'msg2answerFAQ' => Translation::get('msg2answerFAQ'),

phpmyfaq/src/phpMyFAQ/Entity/CategoryEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function setLang(string $lang): CategoryEntity
109109

110110
public function getName(): string
111111
{
112-
return $this->name;
112+
return $this->name ?? '';
113113
}
114114

115115
public function setName(string $name): CategoryEntity

0 commit comments

Comments
 (0)