Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Alex] Possible bug in Category Template

Quote Reply
Re: [Alex] Possible bug in Category Template In reply to
Hi,

We are now using LinksSQL 2.1.0 and the sub template_set inside Links/Category.pm has changed since we did the edit described above. Here is the new code for this sub routine...

sub template_set {
# -------------------------------------------------------------------
# Return the value of template set to use for a given category.
#
my $self = shift;
my $id = shift or return $self->error ('BADARGS', 'FATAL', "Must pass category id to template_set");
return '' unless (exists $self->{schema}->{cols}->{Category_Template});


return $self->{_template_cache}->{$id} if (exists $self->{_template_cache}->{$id});

# If this category has a template set, use it.
my ($cat_info) = $self->select ( ['Category_Template'], { ID => $id })->fetchrow_array;


# Otherwise look at it's parents.
unless ($cat_info) {
my $parents = $self->parents ($id);
foreach my $parent (@$parents) {
($cat_info) = $self->select ( ['Category_Template'], { ID => $parent })->fetchrow_array;
if ($cat_info) {
last;
}
}
}
$self->{_template_cache}->{$id} = $cat_info || '';
return $self->{_template_cache}->{$id};
}



I tried commenting out the following lines, but it did not work...

sub template_set {
# -------------------------------------------------------------------
# Return the value of template set to use for a given category.
#
my $self = shift;
my $id = shift or return $self->error ('BADARGS', 'FATAL', "Must pass category id to template_set");
return '' unless (exists $self->{schema}->{cols}->{Category_Template});


return $self->{_template_cache}->{$id} if (exists $self->{_template_cache}->{$id});

# If this category has a template set, use it.
my ($cat_info) = $self->select ( ['Category_Template'], { ID => $id })->fetchrow_array;


# Otherwise look at it's parents.
# unless ($cat_info) {
# my $parents = $self->parents ($id);
# foreach my $parent (@$parents) {
# ($cat_info) = $self->select ( ['Category_Template'], { ID => $parent })->fetchrow_array;
# if ($cat_info) {
# last;
# }
# }
# }
# $self->{_template_cache}->{$id} = $cat_info || '';
# return $self->{_template_cache}->{$id};
}



So, which lines in this new-look sub routine do I need to comment/delete in order to stop Links from using the category template of its parent directory?

If you don't understand then please start at the top of this read and all should become clear!

Regards

JeffB.

Last edited by:

jeffb: May 1, 2002, 7:20 AM
Subject Author Views Date
Thread Possible bug in Category Template jeffb 4780 Aug 22, 2001, 5:18 PM
Thread Re: Possible bug in Category Template
Alex 4746 Aug 22, 2001, 5:28 PM
Thread Re: Possible bug in Category Template
jeffb 4735 Aug 23, 2001, 10:00 AM
Thread Re: Possible bug in Category Template
Alex 4719 Aug 23, 2001, 11:33 AM
Post Re: Possible bug in Category Template
jeffb 4718 Aug 23, 2001, 11:50 AM
Thread Re: [Alex] Possible bug in Category Template
jeffb 4606 May 1, 2002, 7:18 AM
Post Post deleted by Paul
Paul 4617 May 1, 2002, 7:40 AM
Thread Re: [Alex] Possible bug in Category Template
webmaster33 4614 May 2, 2002, 4:58 AM
Thread Re: [webmaster33] Possible bug in Category Template
jeffb 4600 May 7, 2002, 1:07 AM
Thread Re: [jeffb] Possible bug in Category Template
Alex 4546 May 11, 2002, 9:42 AM
Thread Re: [Alex] Possible bug in Category Template
jeffb 4534 May 12, 2002, 4:56 PM
Thread Re: [jeffb] Possible bug in Category Template
Alex 4531 May 14, 2002, 5:07 PM
Thread Re: [Alex] Possible bug in Category Template
jeffb 4549 May 14, 2002, 5:46 PM
Post Re: [jeffb] Possible bug in Category Template
Alex 4520 May 14, 2002, 6:02 PM
Thread Re: [Alex] Possible bug in Category Template
SeanP 4490 May 14, 2002, 8:58 PM
Post Re: [SeanP] Possible bug in Category Template
jeffb 4506 May 15, 2002, 5:23 PM