Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

A bug in admin.cgi ?

Quote Reply
A bug in admin.cgi ?
I changed the
$LINKS{db_gen_category_list} = 0;

When adding a link and validating it everything works fine.
If I modify a link and validate it I get the error that lsql expects an integer not chars.

I had a look at admin.cgi and found that when modifying it doesn't convert the Category-ID (String) to the numeric ID.

I just copied the code from the validating section.

# Fix up the category name.
($links{$id}{'CategoryID'} !~ /^\d+$/) and ($links{$id}{'CategoryID'} = &get_category_id($links{$id}{'CategoryID'}));
my $t = $links{$id}{CategoryID};

and pasted it under the foreach-loop in modify.

Alex

[This message has been edited by Alex404 (edited January 22, 2000).]
Quote Reply
Re: A bug in admin.cgi ? In reply to
shouldn't you just fix the select field to have value="##" ?

------------------
Jerry Su
Links SQL Licensed
------------------

Quote Reply
Re: A bug in admin.cgi ? In reply to
Hi Alex, I have been watching for some feedback on this thread so I'd know what change would be needed in my scripts. Sorry, I am still clueless here, would you please be so kind as to clarify the change needed?

In admin.cgi >> sub modify_record I have:

Code:
# Fix up the category name.
($in->param('CategoryID') !~ /^\d+$/) and $in->param(-name => 'CategoryID', -value => &get_category_id($in->param('CategoryID')));

Do I replace the entire segment above with:
Code:
# Fix up the category name.
($links{$id}{'CategoryID'} !~ /^\d+$/) and ($links{$id}{'CategoryID'} = &get_category_id($links{$id}{'CategoryID'}));
my $t = $links{$id}{CategoryID};

If not the entire segment, please identify the change needed on my existing code. Thank you so much!

------------------
~ ~ ~ ~ ~
Karen
Quote Reply
Re: A bug in admin.cgi ? In reply to
Thanks!

Alex
Quote Reply
Re: A bug in admin.cgi ? In reply to
In admin.cgi in sub validate_record right after:

foreach $id (@modify_list) {
$record = $val->get_record ($id, 'HASH');
$record or ($error{$id} = "<li>$id (Couldn't find in validation table)") and next;

add:

# Fix up the category name.
($links{$id}{'CategoryID'} !~ /^\d+$/) and ($links{$id}{'CategoryID'} = &get_category_id($links{$id}{'CategoryID'}));

It's around line 258.

Cheers,

Alex