Gossamer Forum
Home : Products : Gossamer Links : Discussions :

[BUG?] v. 2.1. Link count eccentric

Quote Reply
[BUG?] v. 2.1. Link count eccentric
When links appear in muliple categories (aka AltCategories), the link counts are the exact opposite of what is needed.

For example, link A is in categories 1, 2, 3 and 4 ...
The link count is incremented for only one of those categories, so (if there were no other links), the respective category counts might be 0, 0, 1, 0. Which category gets the increment seems to be arbitrary. Same thing happens in the admin interface.
Nevertheless, the grand total link count is incremented by 4, when it should logically be 1.

The earlier v. 2.05 got it right.

GT! Help please -- is this a bug, or are we doing something wrong?
All our links are in multiple categories -- it's not something we can ignore.

Last edited by:

YoYoYoYo: Mar 12, 2002, 10:37 PM
Quote Reply
Re: [YoYoYoYo] [BUG?] v. 2.1. Link count eccentric In reply to
Hi,

The grand total should be 4, we changed this so that grand total reflects the sum of all the links a user would see.

However, the category counts should say 1,1,1,1, not 0,0,1,0. How are you setting up the alternates (in the Browse, or in the Database menu)?

Can you run: http://yoursite/admin/nph-build.cgi?do=repair&force=1 and see if the counts are now correct? If they are still off, let me know and I'll take a look.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] [BUG?] v. 2.1. Link count eccentric In reply to
In Reply To:
The grand total should be 4, we changed this so that grand total reflects the sum of all the links a user would see.

OK, not a bug. We think this should be an option. Now we really need to get it back to how it was before -- our link count must be the actual number, not the apparent number. Can you tell us where the code was changed, which pm. etc? Is it very different from the 2.05 version?

In Reply To:
However, the category counts should say 1,1,1,1, not 0,0,1,0. How are you setting up the alternates (in the Browse, or in the Database menu)?

Can you run: http://yoursite/admin/nph-build.cgi?do=repair&force=1 and see if the counts are now correct? If they are still off, let me know and I'll take a look.

We set up the alternates using SQL Monitor -- it's the only way when there are more than 500 to do. Your suggestion worked -- though we had already run Repair Tables from the Admin menu. So that is OK.

Is it possible that these occasional inconsistencies are related to server/OS? Our still-under-construction main site runs under the conventional FreeBSD/Apache and uses 2.05. I don't want to upgrade the main site until I'm sure everything is right, so I'm testing 2.1 offline at home under Win98/Xitami/ActivePerl.
Quote Reply
Re: [YoYoYoYo] [BUG?] v. 2.1. Link count eccentric In reply to
Hi,

It could be an option, but it looks strange to the user when the sum of the links on the home page != the total listed. =) It's not apparent for large directories, but is noticeable for small ones.

To change the total, you can edit Links/Build.pm and look in sub _grand_total. It should be:

sub _grand_total {
# -------------------------------------------------------------------
# Calculates the total in two queries as it is significantly faster
# on large db's.
#
my ($self, $db) = @_;
my $total = $self->total;
my $unval = $self->count ( { isValidated => 'No' } );
return $total - $unval;
}

if you want the old way of counting.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] [BUG?] v. 2.1. Link count eccentric In reply to
In Reply To:
It could be an option, but it looks strange to the user when the sum of the links on the home page != the total listed. =)
But we all have different users. Ours will expect to know the overall number of sites linked to.


In Reply To:
To change the total, you can edit Links/Build.pm and look in sub _grand_total. It should be:

sub _grand_total {
# -------------------------------------------------------------------
# Calculates the total in two queries as it is significantly faster
# on large db's.
#
my ($self, $db) = @_;
my $total = $self->total;
my $unval = $self->count ( { isValidated => 'No' } );
return $total - $unval;
}

if you want the old way of counting.

That produced an error -- but this seems to work ...
Code:
sub _grand_total {
my $total = $DB->table ('Links')->total;
my $unval = $DB->table ('Links')->count ( { isValidated => 'No' } );
return $total - $unval;
}
Quote Reply
Re: [YoYoYoYo] [BUG?] v. 2.1. Link count eccentric In reply to
Oops, sorry, cut and paste it from 2.0.5. Needed a bit of modification to work in 2.1.0. =)

Cheers,

Alex
--
Gossamer Threads Inc.