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.
Subject Author Views Date
Thread 500 Server Error on add.cgi with gen_category_list Alex 1054 Mar 28, 2001, 7:49 PM
Post Re: 500 Server Error on add.cgi with gen_category_list
TheFox 945 Apr 27, 2001, 8:54 AM