Skip to content

Commit

Permalink
Merge pull request #420 from vanilla/fix/qna-category-literal
Browse files Browse the repository at this point in the history
Fix empty category text in QnA
  • Loading branch information
initvector committed Oct 19, 2016
2 parents e53f319 + 0080789 commit f66a13d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/QnA/views/post.php
@@ -1,4 +1,4 @@
<?php if (!defined('APPLICATION')) { exit(); }
<?php if (!defined('APPLICATION')) { exit(); }
$Session = Gdn::session();
$CancelUrl = '/discussions';
if (c('Vanilla.Categories.Use') && is_object($this->Category)) {
Expand All @@ -18,10 +18,15 @@
$this->fireEvent('BeforeFormInputs');

if ($this->ShowCategorySelector === true) {
$options = [
'Value' => val('CategoryID', $this->Category),
'IncludeNull' => true,
'PermFilter' => array('AllowedDiscussionTypes' => 'Question'),
];
echo '<div class="P">';
echo '<div class="Category">';
echo $this->Form->label('Category', 'CategoryID'), ' ';
echo $this->Form->categoryDropDown('CategoryID', array('Value' => val('CategoryID', $this->Category), 'PermFilter' => array('AllowedDiscussionTypes' => 'Question')));
echo $this->Form->categoryDropDown('CategoryID', $options);
echo '</div>';
echo '</div>';
}
Expand Down

0 comments on commit f66a13d

Please sign in to comment.