Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Unanswered button gives error

This discussion is related to the Q&A addon.
okhawajaokhawaja New
edited August 2016 in Vanilla 2.0 - 2.3

I followed instructions for implementing only the Ask Question big button. Everything is working fine except the Unanswered button. I am using Vanilla 2.2 Getting the below error. I am using latest version of the plugin Q&A. Another issue is that on Mobile the Ask Question button is appearing above the footer, while I want it to appear under the Search bar on Bootstrap theme...

Comments

  • RiverRiver MVP
    edited August 2016

    what version number of Q & A are you using?

    and what did you change?

    in the newquestion module

    change the echo to return

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • @River said:
    what version number of Q & A are you using?

    and what did you change?

    in the newquestion module

    change the echo to return

    Version
    1.2.4

    Did this:

    add this to class.qna.plugin.php

    public function DiscussionsController_Render_Before($Sender) {
    if (C('Plugins.QnA.UseBigButtons')) {
    $QuestionModule = new NewQuestionModule($Sender, 'plugins/QnA');
    $Sender->AddModule($QuestionModule);
    }
    if ($Sender->Data('Discussion.Type') == 'Question') {
    $Sender->SetData('_CommentsHeader', T('Answers'));
    }
    }

    add these lines to your config.php

    $Configuration['Plugins']['QnA']['UseBigButtons'] = TRUE;

    $Configuration['Modules']['Vanilla']['Panel'] = array('MeModule', 'UserBoxModule', 'GuestModule', 'NewDiscussionModule', 'NewQuestionModule','DiscussionFilterModule', 'SignedInModule', 'Ads');

    you also need to change QnA/modules/class.newquestionmodule.php

    from

    echo Anchor(T('Ask a Question'), '/post/discussion?Type=Question', 'Button BigButton NewQuestion');

    to

    echo Anchor(T('Ask a Question'), '/post/question', 'Button BigButton NewQuestion');

  • RiverRiver MVP
    edited August 2016

    ok - all you need to do is reread this comment.

    https://vanillaforums.org/discussion/comment/242922/#Comment_242922

    return Anchor(T('Ask a Question'), '/post/question', 'Button BigButton NewQuestion');

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

    okhawaja
  • RiverRiver MVP
    edited August 2016

    You need to upgrade to vanilla 2.2.1

    and sort the modules. https://vanillaforums.org/discussion/comment/232501/#Comment_232501 to position askmodule question you want in the sort. Reading the other tutorials in the tutorial category again might help you.

    you can also delete the adding of module in the render unanswered it you want.

    same answer as in the other discussion.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

    okhawajaPackham
  • @River said:

    and sort the modules. https://vanillaforums.org/discussion/comment/232501/#Comment_232501 to position askmodule question you want in the sort.

    The latest version of the plugin Q&A has the module "NewQuestionModule" and I have that as the first module in the sort order, so it's fine for the desktop theme. The problem I am having is that for mobile the NewQuestionModule goes to the bottom along with ALL the other modules. All the modules go above the footer for mobile. That is why I have no idea how I can get it to rank above.

    I JUST Found out what was wrong....I copied my current theme and replicated it. Used the replicated theme as Mobile and changed the {asset name="Panel"} part and move it from footer to below the search bar, so now it works!

    Packham
  • @River I just took a new copy of Q&A and changed echo to return, and tried out the plugin with those changes instead of the older changes. Here is what happened:

    Ask a Question button only shows up in Unanswered, when you ask a question it posts it as a type Question, but visually it doesn't look anything different from a regular discussion. Also, commenting in a discussion that's supposed to be a question doesn't make the "Did this answer the question" thing appear, so you can't accept or reject any answers in the discussion. So overall, the suggested change probably needs more modifications than just the change of echo to return.

    Packham
Sign In or Register to comment.