Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
QnA - Best Answer
weavertheme
New
Is there a way to disable the "Best Answer" at the top feature.
We are finding that this seriously hampers our support forum as the "Best Answer" is removed from the normal discussion flow and ends up "lost" at the top.
Best, of course, would be to have a Best Answer at the top, but retain the comment in the normal flow.
0
Comments
You can modify your own copy of the plugin. In
/plugins/QnA/class.qna.plugin.php
find theDiscussionController_BeforeDiscussionRender_Handler
function definition. Comment out the following lines:That should do what you want.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@weavertheme we actually made this an option in config (recent modification)
I have updated the plugin found in the Add-on repo. You can now just add to config.php
QnA.AcceptedAnswers.Filter = FALSE
Sorry I did not see this sooner.
Update
As mentioned below here is proper syntax
['QnA']['AcceptedAnswers']['Filter'] = FALSE;`
Good to know my patch was identical:)
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight I would not doubt it I think you have a good handle on things
I think you meant:
$Configuration['Plugins']['QnA']['AcceptedAnswers']['Filter'] = TRUE;
but that doesn't work when I try it. If I change the new code in class.qna.plugins.php to test for FALSE, it works, but then the config setting seems irrelevant.
And if you have to fix this, then how about another on to skip the "Best Answer" display, too. My moderators really don't like that. I simply put a
return;
at the beginning of theDiscussionController_BeforeDiscussionRender_Handler
function, but that may be breaking the Read/New Comments functionality - don't know for sure.
@weavertheme sorry, I had just noticed I had improper syntax, the post above has been fixed.
I'm using Vanilla 2.2.1
I've tried putting this in config.php to have the Best Answer within the conversation flow, and not on the top:
$Configuration['Plugins']['QnA']['AcceptedAnswers']['Filter'] = FALSE;
It doesn't change anything.
$Configuration['Plugins']['QnA']['AcceptedAnswers']['Filter'] = TRUE;
didn't make a difference too.If i comment out the above mentioned block like this, it does work (Best answers on top, but ALL answers in the conversation flow)
Best regards
If you replace $Configuration['Plugins']['QnA']['AcceptedAnswers']['Filter'] =false; with $Configuration['QnA']['AcceptedAnswers']['Filter'] = false; or if (C('QnA.AcceptedAnswers.Filter', TRUE)) with if (C('Plugins.QnA.AcceptedAnswers.Filter', TRUE)) it would work too.
Awesome.
$Configuration['QnA']['AcceptedAnswers']['Filter'] = FALSE;
works!Thanks!
Glad it worked out!
Just for future reference: If you see c("X.Y.Z" , 'some default value') somewhere, that's basically a shorthand for "check if $Configuration['X']['Y']['Z'] is set, if yes return it if not return 'some default value'".
Thanks!
I've already figured out the correlation between the config.php entry and the code c("X.Y.Z",'some default value').
Best Regards
also comment out this line //$sender->setData('Answers', $answers);