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.

DiscussionPolls PHP error on

This discussion is related to the Discussion Polls addon.
khalwatkhalwat New
edited April 2014 in Vanilla 2.0 - 2.8

I added and activated DiscussionPolls 1.2.3 on Vanilla and received this error when I click on Start a new Discussion or when I click on Attach Poll on an existing discussion:

Fatal Error in DiscussionPolls.PostController_DiscussionFormOptions_Handler();

Undefined property: PostController::$Discussion
The error occurred on or near: /var/www/forums/plugins/DiscussionPolls/class.discussionpolls.plugin.php
268:     // render check box
269:     $Sender->EventArguments['Options'] .= '<li>' . $Sender->Form->CheckBox('DP_Attach', T('Attach Poll'), array('value' => '1', 'checked' => TRUE)) . '</li>';
271:     // Load up existing poll data
272:     if($Sender->Discussion->DiscussionID != NULL) {
273:       $DPModel = new DiscussionPollsModel();
274:       $DiscussionPoll = $DPModel->GetByDiscussionID($Sender->Discussion->DiscussionID);
275:     }


Additional information for support personnel:
Application: Vanilla
Application Version:
PHP Version: 5.3.3
Operating System: Linux
Server Software: Apache/2.2.15 (CentOS)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14
Request Uri: /post/discussion/7
Controller: DiscussionPolls
Method: PostController_DiscussionFormOptions_Handler


  • Backtrace:
    [/var/www/forums/plugins/DiscussionPolls/class.discussionpolls.plugin.php:272] PHP::Gdn_ErrorHandler();
    [/var/www/forums/library/core/class.pluginmanager.php:648] DiscussionPolls->PostController_DiscussionFormOptions_Handler();
    [/var/www/forums/library/core/class.pluginmanager.php:590] Gdn_PluginManager->CallEventHandler();
    [/var/www/forums/library/core/class.pluggable.php:127] Gdn_PluginManager->CallEventHandlers();
    [/var/www/forums/applications/vanilla/views/post/discussion.php:44] Gdn_Pluggable->FireEvent();
    [/var/www/forums/library/core/class.controller.php:659] PHP::include();
    [/var/www/forums/library/core/class.controller.php:1073] Gdn_Controller->FetchView();
    [/var/www/forums/library/core/class.pluggable.php:193] Gdn_Controller->xRender();
    [/var/www/forums/applications/vanilla/controllers/class.postcontroller.php:225] Gdn_Pluggable->__call();
    [/var/www/forums/applications/vanilla/controllers/class.postcontroller.php:225] PostController->Render();
    [/var/www/forums/applications/vanilla/controllers/class.postcontroller.php:225] PostController->Discussion();
    [/var/www/forums/library/core/class.dispatcher.php:322] PHP::call_user_func_array();
    [/var/www/forums/index.php:53] Gdn_Dispatcher->Dispatch();

  • This needs to be reported on the github page

    The solution should be something like

    if(GetValueR('Discussion.DiscussionID',$Sender)) {

    instead of

    if($Sender->Discussion->DiscussionID != NULL) {

    grep is your friend.

  • hgtonighthgtonight ∞ · New Moderator

    Thanks for the heads up, I just updated the github version with @x00's fix. Could you (@khalwat) test it out and let me know if that fixes your issue?

    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.