Gossamer Forum
Home : Products : Others : Gossamer Community :

unable to query GLinks category

Quote Reply
unable to query GLinks category
Hi there,

I'm trying to query my GossamerLinks 3.04. Category database using a community global from within community.cgi.

like this:

lib->import('/path/to/links/admin');
my $cond = GT::SQL::Condition->new (@cond);
my $cat_db = $DB->table('Category');
my $sth = $cat_db->select ( {%$p},$cond );

GT::Config (23445): Unknown option 'sort_order' passed to GT::Config->load at (path/to/links/admin/GT/SQL/Table.pm line 197)

anyone know what I'm doing wrong?

thanks for any help.

peace.

Last edited by:

klangan: Sep 19, 2005, 11:56 AM
Quote Reply
Re: [klangan] unable to query GLinks category In reply to
Is that *all* the code your using? You don't even use "sort_order", which the below suggests you do;

Unknown option 'sort_order'

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unable to query GLinks category In reply to
Yeah, that's all the important stuff.

sort_order is something internal to GT::SQL::Table and gets called regardless of whether or not I order by something.

here's part of the GT code that contains sort_order.
sub load_state {
.....
$self->{schema} = GT::Config->load(
"$self->{connect}->{def_path}/$name.def" => {
cache => !($reload and $reload eq 'reload'),
chmod => 0666,
debug => $self->{_debug},
sort_order => sub {
my ($keya, $keyb, $vala, $valb) = @_;
if (ref $vala eq 'HASH' and ref $valb eq 'HASH' and exists $vala->{pos} and exists $valb->{pos}) {
return $vala->{pos} <=> $valb->{pos};
}
else {
return $keya cmp $keyb;
}
},
header => $header
}
);
......
return 1;
}


Again, this is only causing problems when trying to run a query on the Category or Links table. I have my community installed in admin/lib where admin is the admin path for my links program as well.

thanks for any help.

peace.