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.

Q&A not working anymore?

businessdadbusinessdad Stealth contributor MVP
edited September 2012 in Vanilla 2.0 - 2.8

I got the latest DEV version of Q&A plugin some time ago, when I modified it to send a notification when an answer is rejected. Today I was going through my forum, and I noticed that, despite Q&A being enabled, the Ask a question/Start a discussion buttons are no longer displayed. Initially I thought I could have broken something (although I haven't changed the plugin since I added the notification stuff), so I went "back in history" to see if the clean version would work. Issue is, it doesn't.

I did some investigation, switching to previous versions one by one, and it seems that last working version was the one with hash 08ff3ee2cbcbef865fbcaf369d0aee2928959c1c, checked in by Mark O'Sullivan on 30/06/2012 23:50:42. From the next checkin onwards, the "New Discussion" form is the default Vanilla one, without the "Ask a Question" option.

I'm using Vanilla 2.0.18.x, could it be that Q&A plugin was ported to 2.1 and backported incorrectly?



  • Options
    businessdadbusinessdad Stealth contributor MVP

    I think I found the reason why Q&A doesn't work anymore in Vanilla 2.0.18.x: the two methods responsible for altering the form were removed from the version immediately after the one I indicated. To be more precise, the methods are the following:

    • QnAPlugin.PostController_BeforeFormInputs_Handler()
    • QnAPlugin.PostController_Render_Before() (although this one doesn't seem to make much of a difference).

    In their place, the following methods were added:

    • QnAPlugin.PostController_AfterForms_Handler()
    • QnAPlugin.PostController_Question_Create()
    • QnAPlugin.PostController_BeforeDiscussionRender_Handler()

    The key issue here seems to be that event "AfterForms" doesn't exist in Vanilla 2.0.18.x, therefore the new "form altering" method is never called. I tried putting QnAPlugin.PostController_BeforeFormInputs_Handler() back in place, while keeping the new methods, and everything seems ok, but I won't commit such change as it's fruit of guesswork, rather than proper analysis and test.
    Besides, I did not test it on Vanilla 2.1, it may very well happen that the New Discussion form gets messed up because the rendering method runs twice.

    If anyone has the same proble, I'd suggest to revert to version 1.0.8 until this issues are solved.

  • Options
    edited January 2013

    Thanks - had the same problem, three months later with QnA 1.1.3 and Vanilla 2.0.18, and was scratching my head trying to work out what was going on. It looks like the QnA plugin is following the latest Vanilla developments, but is not taking backward compatibility into account. When you upgrade QnA then the core most be upgraded with it, and vice-versa.

    Thanks for the tip. It has saved me much time.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    @JasonJudge I'm glad that my headache has been useful, in some way. In my case, I didn't upgrade Vanilla Core, as I don't use Beta versions in productions, therefore I fixed the plugin itself (although the fix has not been maintained in later versions).

  • Options

    the way I see it, is it wasn’t really back-ported. it was intended for 2.1 the previous version is for 2.0.

    grep is your friend.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    @x00 said:
    the way I see it, is it wasn’t really back-ported. it was intended for 2.1 the previous version is for 2.0.

    You're right, it was a "forward only" progress. The only issue is that the repository was not branched (or tagged) to the latest stable version, and that the plugin activates correctly on Vanilla 2.0. Clearly, they ported it to 2.1, but the status of backward compatibility was ambiguous.
    Personally, I believe that clearly describing requirements and compatibility of all the software should become a habit for all Developers, to save Users and other Developers a lot of "figuring out".

    Note: nothing personal against any of the Developers, sometimes I also forget to write proper release notes and documentation. It's just that I dislike the whole idea of "investigating" and "figuring out", as I believe that any Developer should consider writing documentation a basic, integral part of Software Development, rather than an optional, less important task.

Sign In or Register to comment.