Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Search Error

Quote Reply
Search Error
When i try to search through links i always get zero results unless the search string matches the category. for some reason it doesn't seem to be searching through the links just the categories.

Also i'm having problems with the search in the admin panel. I keep getting the following errors:

You must specify at least one search term.

A fatal error has occured:
GT::SQL::Relation (28423): Unknown method '_is_pk' called at /home/sites/site31/web/cgi-bin/admin/GT/SQL/Display/HTML/Table.pm line 238.


Please enable debugging in setup for more details.

GT::SQL::Relation (28423): Unknown method '_is_pk' called at /home/sites/site31/web/cgi-bin/admin/GT/SQL/Display/HTML/Table.pm line 238.


Then when i enable debug i get:

Links (25446): Links::fatal called at (eval 19) line 29 with arguments
(GT::SQL::Relation (25446): Unknown method '_is_pk' called at /home/sites/site31/web/cgi-bin/admin/GT/SQL/Display/HTML/Table.pm line 238.).


Links (25446): GT::Base::_generate_fatal called at /home/sites/site31/web/cgi-bin/admin/GT/Base.pm line 156 with arguments (GT::SQL::Relation=HASH(0x844410c), _is_pk, lsql_Links.ID).


GT::SQL::Relation (25446): Unknown method '_is_pk' called at /home/sites/site31/web/cgi-bin/admin/GT/SQL/Display/HTML/Table.pm line 238.
Quote Reply
Re: [vanhut] Search Error In reply to
i also wanted to add that when i search anything other than the links table it works fine. Is there a limit to the number of fields in th links table?
Quote Reply
Re: [vanhut] Search Error In reply to
How does your build_sort_order_search looks like?
Quote Reply
Re: [Payooo] Search Error In reply to
build_sort_order_search = score

build_sort_order_search_cat = score
Quote Reply
Re: [vanhut] Search Error In reply to
I have no clue Unsure

Try to

Rebuild Search
Repair Tables ...

or Resync Database if you changed some fields outside Links ...
Quote Reply
Re: [Payooo] Search Error In reply to
it may have something to do with my Table.pm or relation.pm file. could you by chance let me see yours by linking it or emailing me it.

here is the error again

GT::SQL::Relation (25446): Unknown method '_is_pk' called at /home/sites/site31/web/cgi-bin/admin/GT/SQL/Display/HTML/Table.pm line 238.
Quote Reply
Re: [vanhut] Search Error In reply to
what is "is_pk", and where have you put it into the links sql system?
Quote Reply
Re: [TLA] Search Error In reply to
it is a funtion included with lsql.. i believe it is in the gt:sql:table.pm .. this is it:

# Returns true if first argument is a primary key.
sub _is_pk {
for (@{$_[0]->{schema}->{pk}}) {
return 1 if $_ eq $_[1];
}
return 0;
}
-------------

this is how it is used in GT/SQL/Display/HTML/Table.pm

.....

# Display any search options if requested.
if ($self->{search_opts}) {
$out .= qq~<td $self->{td} width="10%"><font $self->{val_font}>~;
$out .= $self->_mk_search_opts(
{
name => $field_name,
def => $self->{cols}->{$col},
pk => $self->{db}->_is_pk($col),
unique => $self->{db}->_is_unique($col)
}
) || '&nbsp;';
$out .= "</font></td>";
}

..............
could i be missing a " use GT:SQL:table

if you open fileman and do a search contents for '_is_pk' you should get the files i'm talking about.
Quote Reply
Re: [vanhut] Search Error In reply to
What did you do to it to make it throw up the error mentioning is_pk? Can't you track that down and undo it? There was a point (logically), when the system went from not generating that error to generating that error. What happened to the install at that point?

Last edited by:

TLA: Jul 24, 2002, 3:42 PM
Quote Reply
Re: [TLA] Search Error In reply to
Or did it do that straight at the beginning of the install?
Quote Reply
Re: [,] Search Error In reply to
i think it may have done it since the install, i'm not sure.

To get the error all i do is go to links sql admin, click on database link on top. then in left panel i choose Links and Search under the editor menu. Then i ender the search info in the form and submit it. that is when i get the error.

the only thing i've edited is the checkbox function and i'm not sure if that is even in the same file. can anyone post there section of the code from that file so i can see if it is the same. or can someone confirm if it is the same or different
Quote Reply
Re: [,] Search Error In reply to
here is what i know

this is the error one more time

GT::SQL::Relation (525): Unknown method '_is_pk' called at
/home/sites/site31/web/cgi-bin/admin/GT/SQL/Display/HTML/Table.pm line 238.

_is_pk is a sub in GT/SQL/Table.pm

the following lines are in Relation.pm use GT::SQL::Condition;
use GT::SQL::Base;
use GT::SQL::Table;
Quote Reply
Re: [vanhut] Search Error In reply to
I got the "validate links" link to work on the admin home page. What was wrong was that i had a field in my table called 'sb' which is also a variable in the code. I'm assuming in the code the sb stands for sort by.

I went through my other fields and found one more that is used in some of the code. when i changed this all the errors went away.

So if anyone comes accross strange erros check if your field names match any variables used in the code

Last edited by:

vanhut: Aug 5, 2002, 3:55 PM