HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Discussion Polls 1.0.1 Feed Back

jeongweejeongwee Vanilla version 2.6 ✭✭
edited August 2013 in Feedback

awesome plugin, but i met a bug .
when i opening a new discussion ,its not a empty discusstion to let me edit. the poll options,poll question,poll title have been wrote by automatic.
and i cant even edit it, it means i cant put the cursor there by click the left key of my mouse.
so i tryed to write the discussion title and content, post it first and try to edit later.
but i cant even post it....
says by my site :Error
You must enter a valid poll title!
image

Comments

  • ShadowdareShadowdare r_j MVP
    edited August 2013

    @hgtonight: https://github.com/hgtonight/DiscussionPolls/issues/1

    Problem: The first poll gets loaded up when a creating new discussion. Reproducible on both Vanilla 2.0.18.8 and 2.1b1.

    Version: DiscussionPolls 1.0.1

    Cause:

    DiscussionPollsModel()::GetByDiscussionID() shouldn't get called when $Sender->Discussion->DiscussionID is NULL in method PostController_DiscussionFormOptions_Handler().

    Fix:

    Open this file: /plugins/DiscussionPolls/class.discussionpolls.plugin.php

    Find this block on lines 216-218:

        // Load up existing poll data
        $DPModel = new DiscussionPollsModel();
        $DiscussionPoll = $DPModel->GetByDiscussionID($Sender->Discussion->DiscussionID);
    

    Replace it with:

        // Load up existing poll data
        if($Sender->Discussion->DiscussionID != NULL) {
          $DPModel = new DiscussionPollsModel();
          $DiscussionPoll = $DPModel->GetByDiscussionID($Sender->Discussion->DiscussionID);
        }
    

    Add Pages to Vanilla with the Basic Pages app

  • jeongweejeongwee Vanilla version 2.6 ✭✭

    solved thx

  • x00x00 MVP
    edited August 2013

    there are NULL values in the database, becuase NullDefault was true. that is why (otherwise it wouldn't it lookup a null discussion)

    Don't worry I have forked and will be submitting a pull request, with a bunch of fixes).

    grep is your friend.

  • x00x00 MVP
    edited August 2013

    @hgtonight

    I have submitted a pull request, however as it is unnecessary to put code in plugins to remove null value it would require those already using it to drop these tables

    GDN_DiscussionPollAnswers
    GDN_DiscussionPollQuestionOptions
    GDN_DiscussionPollQuestions
    GDN_DiscussionPolls
    

    backup first

    Unless of course you want to remove the null records manually.

    grep is your friend.

  • hgtonighthgtonight ∞ · New Moderator

    A special thanks to @Shadowdare and @x00 for their contributions via GitHub.

    I have merged in their pull requests and will release a new version shortly.

    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 said:
    A special thanks to Shadowdare and x00 for their contributions via GitHub.

    I have merged in their pull requests and will release a new version shortly.

    @hgtonight Just got around to looking at your plugin and giving it a spin.
    Really nicely done.

    The user interface for adding questions and options is great.

    Once you release the new version to the add-ons section with the tweaks that resolve the nulls and resultant issue , I think it will be perfect.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    @peregrine said:
    Once you release the new version to the add-ons section with the tweaks that resolve the nulls and resultant issue , I think it will be perfect.

    I didn't realize it, but I never mentioned that I released 1.1. The current version should take care of the issues you outlined.

    1.2 is in the works and is only awaiting some downtime to get pushed out. :D

    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.

  • peregrineperegrine MVP
    edited September 2013

    I never downloaded any versions but version 1.1

    In version 1.1, In vanilla 2.0.18.8 .

    if I enter a poll. Add two questions. Navigate to add a third question, but decide I don't want to add a third question. and back up to the second question. I can't press save. I get the you must add question.

    Perhaps this is resolved in v 1.2 when released.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited September 2013

    Another idea. Would be a preview before the save. Adding more work to your slate

    e.g. This is your poll and show what it will look like. With a question Are you sure?

    And only then it will save the previewed poll.

    A few other possible useful features.

    1 - put a poll icon on the discussions page for any discussion that has a poll.
    2 - put a module in panel that shows the titles of the five polls that were last voted upon (or have a choice with module (five polls that were last created).
    3 - And a master index of all poll titles with links to discussions.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    @peregrine and others, please test my new version. I just released 1.2.

    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.