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
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

DiscussionPolls PHP error on 2.0.18.10

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

I added and activated DiscussionPolls 1.2.3 on Vanilla 2.0.18.10 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>';
270: 
271:     // Load up existing poll data
272:     if($Sender->Discussion->DiscussionID != NULL) {
273:       $DPModel = new DiscussionPollsModel();
274:       $DiscussionPoll = $DPModel->GetByDiscussionID($Sender->Discussion->DiscussionID);
275:     }
276: 

.....

Additional information for support personnel:
Application: Vanilla
Application Version: 2.0.18.10
PHP Version: 5.3.3
Operating System: Linux
Server Software: Apache/2.2.15 (CentOS)
Referer: http://forums.crushlivepoker.com/categories/your-feedback
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

Comments

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

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

    The solution should be something like

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

    instead of

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

    grep is your friend.

    peregrineShadowdarehgtonight
  • 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?

    https://github.com/hgtonight/Plugin-DiscussionPolls

    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.