Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Is there a way to close the poll without closing the thread?

This discussion is related to the Discussion Polls addon.

Title is my question: any way to close a poll without closing the thread for discussion?



  • hgtonighthgtonight ∞ · New Moderator

    There is no way from the UI to close a poll. There is a method to close the poll via the model, so it would be relatively trivial to add.

    Something like the following:

    public function Base_DiscussionOptions_Handler($Sender) {
        if(!CheckPermission('Plugins.DiscussionPolls.Manage')) {
        $Sender->Options .= Wrap(Anchor($Label, '/discussion/closepoll/' . $Discussion->DiscussionID), 'li');
    public function DiscussionController_ClosePoll_Create($Sender, $Args) {
        if(!CheckPermission('Plugins.DiscussionPolls.Manage')) {
            throw PermissionException();
        $DiscussionID = $Args[0];
        $Discussion = $Sender->DiscussionModel->GetID($DiscussionID);
        if ($Discussion) {
            Redirect('/discussion/' . $Discussion->DiscussionID);
        else {
            throw NotFoundException();

    Untested, but that should add a new discussion option to forcibly close the poll. I would suggest adding a check to only have the option if the poll is currently open. And perhaps a method to reopen an accidentally closed poll.

    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.

Sign In or Register to comment.