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.

Internal Server Error

edited February 2015 in Vanilla 2.0 - 2.8

Jason,

Your plugin looks great. All I'd have to do is have more than one extra GDN_Discussion columns and modify your plugin a bit.

However I can't get yours to work. Here's what I do. I place the ExtraDiscussionData in my plugin folder, change this line:

$ExtraDiscussionDataConfig['ColumnName'] = 'Rating';

to this:

$ExtraDiscussionDataConfig['ColumnName'] = 'ExtraData1';

since the extra MySQL column I named "ExtraData1". Then I click Enable your plugin. However I see this message:

Internal Server Error

The server encountered an internal error or
misconfiguration and was unable to complete
your request.

Please contact the server administrator,
 cgiadmin@yourhostingaccount.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.

More information about this error may be available
in the server error log.

Additionally, a 500 Internal Server Error
error was encountered while trying to use an ErrorDocument to handle the request.

Note that ExtraData1 has the following:

    Field = ExtraData1
    Type = int(1)
    Collation = [Blank]
    Attributes = [Blank] 
    Null = No
    Default = 0
    Extra = [Blank]

I'm not experienced with MySQL so I could be doing something wrong!

I'm using the following config.php file:

<?php if (!defined('APPLICATION')) exit();
global $ExtraDiscussionDataConfig;
$ExtraDiscussionDataConfig = [];

$ExtraDiscussionDataConfig['ColumnName'] = 'ExtraData1';

$ExtraDiscussionDataConfig['ShowFormWhen'] = function($Sender) {
    # Same logic as GetItemID in DiscussionAbout
    if (isset($Sender->Discussion) && is_numeric($Sender->Discussion->ScriptID)) {
        return $Sender->Discussion->ScriptID != '0';
    }
    if (isset($_REQUEST['script']) && is_numeric($_REQUEST['script'])) {
        return $_REQUEST['script'] != '0';
    }
    return false;
};
$ExtraDiscussionDataConfig['Values'] = [
    '0' => [
        'form_markup' => ' No rating (just a question or comment)',
        'show_markup' => ''
    ],
    '1' => [
        'form_markup' => ' Report script (malware, stolen code, or other bad things requiring moderator review)',
        'show_markup' => ''
    ],
    '2' => [
        'form_markup' => ' Bad (doesn\'t work)',
        'show_markup' => ''
    ],
    '3' => [
        'form_markup' => ' OK (works, but could use improvement)',
        'show_markup' => ''
    ],
    '4' => [
        'form_markup' => '  Good (works well)',
        'show_markup' => ''
    ]
];

?>

Comments

  • JasonBarnabeJasonBarnabe Cynical Salamander ✭✭
    edited February 2015

    The config.php you're using is my own personal config.php that should not have been included in the distribution. Please try 1.1, which I've just uploaded, that removes this file and contains a few extra fixes. Then, copy config-example.php to config.php and make your required changes.

    Currently this plugin only supports one column of extra data. Suggested changes to make it support multiple would be considered!

  • Thanks for updating the addon!

    Hm, followed your instructions and still the same error..

    (But I'm not sure what the config-example.php (that was renamed to config.php and edited) would change -- the earlier config file I posted seems valid too, looking at the code.)

    Any other ideas?

  • hgtonighthgtonight ∞ · New Moderator

    You might check out Discussion Extender if you are looking to add multiple fields to every discussion: http://vanillaforums.org/addon/discussionextender-plugin

    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.

  • JasonBarnabeJasonBarnabe Cynical Salamander ✭✭

    The config.php you posted is valid for me, but will not be valid for you. For example, $Sender->Discussion->ScriptID will not exist for you, and you'll get errors.

    Can you post your current config.php and the error you're getting (set $Configuration['Debug'] = TRUE; in Vanilla's conf/config.php.

  • Thanks hgtonight, I'm looking in to that one too.

    Thanks JasonBarnabe,

    My config.php file has no $Configuration['Debug'] line already, so I added one and set it to TRUE;

    With the $Configuration['Debug'] = TRUE; line, when I click Enable on your addon, it says "The addon could not be enabled because it generated a fatal error:" and then has an empty set of <pre> tags.

    Without the $Configuration['Debug'] = TRUE; line (meaning, back to the original config.php file), when I click Enable on your addon, it says "The addon could not be enabled because it generated a fatal error:" and then has the following generic error inside <pre> tags:

    Internal Server Error
    
    The server encountered an internal error or
    misconfiguration and was unable to complete
    your request.
    
    Please contact the server administrator,
     cgiadmin@yourhostingaccount.com and inform them of the time the error occurred,
    and anything you might have done that may have
    caused the error.
    
    More information about this error may be available
    in the server error log.
    
    Additionally, a 500 Internal Server Error
    error was encountered while trying to use an ErrorDocument to handle the request.
    

    Where should I find the config debug output?

    Thanks,
    David

  • JasonBarnabeJasonBarnabe Cynical Salamander ✭✭
  • edited February 2015

    Thanks JasonBarnabe,

    I set that and still get the same error message.

    It's important to note that:

    1) The link you sent describes how to turn the "bonk" screen into some useful information. In fact, I never get to the "bonk" screen. Instead, whenever I click "Enable" for the addon, it fails (so it never gets enabled, so I can never see the bonk screen). When it fails, it simply says at the top of the screen (while I'm still sitting in Dashboard in the enable/disable plugins screen, it simply says at the top of the screen the text I pasted above: "Internal Server Error..." etc.

    So, when I say I still get the same error message, I still see the Internal Server Error on the Dashboard > Plugins screen, and the plugin never gets enabled.

    2) I added $Configuration['Garden']['Errors']['MasterView'] = 'deverror.master.php'; to the config file as it says, but that has no effect -- because I never got to the bonk screen in the first place.

    Hope that makes sense.

    You mentioned "The config.php you posted is valid for me, but will not be valid for you. For example, $Sender->Discussion->ScriptID will not exist for you, and you'll get errors." Can you tell me how to generate/find a valid ScriptID for me? That might solve the problem too.

    Thanks,
    David

  • JasonBarnabeJasonBarnabe Cynical Salamander ✭✭

    ScriptID is a custom field specific to my install. Your file shouldn't reference it.

    Can you check your server error log? Maybe that will have the info.

  • i only use plugins that can be copied and then installed , this app is useless.

  • R_JR_J Ex-Fanboy Munich Admin

    You have a quite negative approach of communicating. Not everything you don't need is useless.

Sign In or Register to comment.