Gossamer Forum
Home : Products : Gossamer Links : Discussions :

2.1.0 BUG???

(Page 1 of 2)
> >
Quote Reply
2.1.0 BUG???
I have my "search_maxhits" set to 20 in the setup>search options, but it always displays one more link then what I've set. For example, if I set it to 20, it displays 21 per page. If I set it to 19, it displays the number I want, 20. This does look as though it is a bug because the demo running on GT's site displays 26 per page, and I know the default is 25.

Sean
Quote Reply
Re: [SeanP] 2.1.0 BUG??? In reply to
Someone posted this a day or two ago, I couldn't find the link to show you though.
Quote Reply
Re: [SeanP] 2.1.0 BUG??? In reply to
It was me who posted it, it's the same for the forum...

http://www.gossamer-threads.com/...rum.cgi?post=183514;

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] 2.1.0 BUG??? In reply to
I looked, but I guess I missed that post... Smile

Hopefully a staff member can give us a fix for this one...

Sean
Quote Reply
Re: [SeanP] 2.1.0 BUG??? In reply to
I guess the quick solution would be to change:

my $mh = $IN->param('mh');

to

my $mh = $IN->param('mh') - 1;

...in GForum::Search;

...not that I've tested this possible solution or anything :)
Quote Reply
Re: [SeanP] 2.1.0 BUG??? In reply to
Hi,

This is a bug. To fix edit GT/SQL/Search/STH.pm and change around line 79 from:

$self->{max_index} = $self->{index} + $self->{mh};

to:

$self->{max_index} = $self->{index} + $self->{mh} - 1;

While you are there, this is also a bug on complex sort orders not ordering properly. Change the code at line 62:

Code:
unless ($self->{'score_sort'}) {
if ( $self->{'sb'} and ( $self->{'sb'} ne 'score' ) and not( ref( $self->{sb} ) ) ) {
if ( $self->{'sb'} =~ /^\w+$/ ) {
if ($self->{'sb'} =~ /\s(?:asc|desc)/i) {
$sb = 'ORDER BY ' . $self->{'sb'};
}
else {
$sb = 'ORDER BY ' . $self->{'sb'} . ' ' . $self->{so};
}
}
else {
$self->error( 'BASDB', 'WARN', $self->{sb} );
}
}

elsif ( ( ref $self->{'sb'} ) eq 'ARRAY' ) {
foreach ( @{$self->{'sb'}} ) {
/^w+$/ or $self->error( 'BASDB', 'WARN', $self->{sb} ), next;
};
$sb = 'ORDER BY ' . join(',', @{$self->{'sb'}});
}
}


to

Code:
unless ($self->{'score_sort'}) {
if ( $self->{'sb'} and ( $self->{'sb'} ne 'score' ) and not( ref( $self->{sb} ) ) ) {
if ( $self->{'sb'} =~ /^[\w\s,]+$/ ) {
if ($self->{'sb'} =~ /\s(?:asc|desc)/i) {
$sb = 'ORDER BY ' . $self->{'sb'};
}
else {
$sb = 'ORDER BY ' . $self->{'sb'} . ' ' . $self->{so};
}
}
else {
$self->error( 'BASDB', 'WARN', $self->{sb} );
}
}

elsif ( ( ref $self->{'sb'} ) eq 'ARRAY' ) {
foreach ( @{$self->{'sb'}} ) {
/^[\w\s,]+$/ or $self->error( 'BASDB', 'WARN', $self->{sb} ), next;
};
$sb = 'ORDER BY ' . join(',', @{$self->{'sb'}});
}
}


Sorry about that,

Cheers,

Alex
--
Gossamer Threads Inc.

Last edited by:

Alex: Mar 20, 2002, 2:51 PM
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
Thanks Alex!

Sean
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
Alex,

The fix for the search_maxhits worked just fine, but the sorting fix didn't seem to work correctly for me. My web site is not in production yet, so you can use it test this if you would like. I have sent you a PM with the login details.

Thanks,
Sean
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
The problems seem to be different now. When I add a field with "DESC", no links results are displayed. Kinda weird...

Sean
Quote Reply
Re: [SeanP] 2.1.0 BUG??? In reply to
Sean, Alex,

I had the same problem too with this fix for the search sort order. When not adding ASC or DESC to the column name to sort by, I get inconsistent sorting problems too.

Hannah
Quote Reply
Re: [hannahmackenzie] 2.1.0 BUG??? In reply to
Me too Unsure

Help!
Quote Reply
Re: [Payooo] 2.1.0 BUG??? In reply to
I could get mine to work by using the following Search.pm and replacing what was in:

/GT/SQL/Search/NONINDEXED/Search.pm

You might want to try backing up your file and then trying this one to see if it works for you.

I don't know the specific parts that were modified from the original, and don't have enough time right now to look for it, but this is the file that I use that is working.

-FrankM
Quote Reply
Re: [FrankM] 2.1.0 BUG??? In reply to
I'm using the INTERNAL indexing, so I think my search.pm would be different. Not sure...

Sean

Last edited by:

SeanP: Mar 11, 2002, 12:53 PM
Post deleted by FrankM In reply to
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
Alex,

Help with this would be very appreciated...
Quote Reply
Re: [SeanP] 2.1.0 BUG??? In reply to
Hi,

Sorry about the late reply on this, I've edited my above post to contain the proper fix.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
This fix (second) doesn't sort search results the right way (at least for me).

FrankM's fix works for NONINDEXED/Search.pm ...

Heeeelp!
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
Has the download been updated?

Thanks.

------------------------------------------
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
Sorry, but that second fix doesn't work for me either.

Sean
Quote Reply
Re: [SeanP] 2.1.0 BUG??? In reply to
Hi,

Ack, I updated the first part of the code, not the second. The edited version is now the correct version.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
Doh! Laugh

If I setup a column with a score and set only a few links with a score of 1 (the rest are 0), then sort by that column with DESC, should it display those links first on EVERY page? Shouldn't it display those links only once? As it is now, I am getting the links that I have set to 1 displayed first on EVERY page.

Sean

Last edited by:

SeanP: Mar 20, 2002, 5:32 PM
Quote Reply
Re: [Alex] 2.1.0 BUG??? In reply to
Hi,

I tried replacing the code in: GT/SQL/Search/Base/STH.pm

with the newly edited one by Alex, and then changed my search mode for Links to Internal, but then I get sorting that doesn't really work correctly as designated in the setup for the search results. I can get things to work for nonindexed, though, so I guess I'll stick to that for now.

-FrankM

Last edited by:

FrankM: Mar 20, 2002, 5:35 PM
Quote Reply
Re: [FrankM] 2.1.0 BUG??? In reply to
Anybody with a working code?
Quote Reply
Re: [Payooo] 2.1.0 BUG??? In reply to
Alex?
Quote Reply
Re: [Payooo] 2.1.0 BUG??? In reply to
Alex is currently working on a fix. I just talked with him this morning.

Sean
> >