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.

DiscussionPolls PHP error on

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

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


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

  • 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.