Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Error Posting Questions #701

Merged
merged 2 commits into from Apr 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 4 additions & 10 deletions plugins/QnA/class.qna.plugin.php
Expand Up @@ -1112,13 +1112,10 @@ public function postController_afterForms_handler($sender) {
* @param PostController $sender Sending controller instance.
*/
public function postController_question_create($sender, $categoryUrlCode = '') {
// Create & call PostController->discussion()
$sender->View = PATH_PLUGINS.'/QnA/views/post.php';
$sender->setData('Type', 'Question');
$sender->discussion($categoryUrlCode);
if (!$sender->Request->isAuthenticatedPostBack()) {
throw forbiddenException('GET');
}
// Create & call PostController->discussion()
$sender->View = PATH_PLUGINS . '/QnA/views/post.php';
$sender->setData('Type', 'Question');
$sender->discussion($categoryUrlCode);
}

/**
Expand All @@ -1127,12 +1124,9 @@ public function postController_question_create($sender, $categoryUrlCode = '') {
* @param PostController $sender Sending controller instance.
*/
public function postController_beforeDiscussionRender_handler($sender) {
// Override if we are looking at the question url.
if ($sender->RequestMethod == 'question') {
$sender->Form->addHidden('Type', 'Question');
$sender->title(t('Ask a Question'));
$sender->setData('Breadcrumbs', [['Name' => $sender->data('Title'), 'Url' => '/post/question']]);
}
}

/**
Expand Down