Gossamer Forum
Home : Products : Gossamer Links : Discussions :

500 Server Error on add.cgi with gen_category_list

Quote Reply
500 Server Error on add.cgi with gen_category_list
Hi,

We've just fixed a bug that will happen if you set db_gen_category_list to no, and try to add a category, you get a 500 server error.

To fix edit add.cgi and replace line 102:

Code:
# Setup the language for GT::SQL.
local $GT::SQL::ERRORS->{ILLEGALVAL} = Links::language('ADD_ILLEGALVAL');
local $GT::SQL::ERRORS->{UNIQUE} = Links::language('ADD_UNIQUE');
local $GT::SQL::ERRORS->{NOT_NULL} = Links::language('ADD_NOTNULL');
local $Links::Link::ERRORS->{NOCATEGORY} = Links::language('ADD_NOCATEGORY');
$Links::Link::ERRORS ||= {}; # silence -w

# Validate the form input..
my $db = $DB->table ('Links');
my $cdb = $DB->table ('Category');
my $cat_links = $DB->table ('CatLinks');
my $name = $input->{'Contact_Name'} || $input->{'Contact Name'} || ($USER ? $USER->{Name} : '');
my $email = $input->{'Contact_Email'} || $input->{'Contact Email'} || ($USER ? $USER->{Email} : '');
with:

Code:
# Validate the form input..
my $db = $DB->table ('Links');
my $cdb = $DB->table ('Category');
my $cat_links = $DB->table ('CatLinks');
my $name = $input->{'Contact_Name'} || $input->{'Contact Name'} || ($USER ? $USER->{Name} : '');
my $email = $input->{'Contact_Email'} || $input->{'Contact Email'} || ($USER ? $USER->{Email} : '');

# Setup the language for GT::SQL.
local $GT::SQL::ERRORS->{ILLEGALVAL} = Links::language('ADD_ILLEGALVAL');
local $GT::SQL::ERRORS->{UNIQUE} = Links::language('ADD_UNIQUE');
local $GT::SQL::ERRORS->{NOT_NULL} = Links::language('ADD_NOTNULL');
local $Links::Link::ERRORS->{NOCATEGORY} = Links::language('ADD_NOCATEGORY');
$Links::Link::ERRORS ||= {}; # silence -w
My thanks to Christian for the use of his system to track this bug down.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: 500 Server Error on add.cgi with gen_category_list In reply to
I have set db_gen_category_list to yes. And get a Internal Server Error when trying to add a Link. ( The link data have add, but no success message, just have an Internal Server Error message)

We have do the clean install and using the default templates, and still not work! Please Help!

TheFox