Hi, Please try this code, I don't think the error is related to any missing or wrongly named columns, it is just a few minor code issues...
Try this (untested):
my $cat_id = $tags->{CategoryID};
return '' unless ($tags->{ShowSubCategoryLinks});
my $subcats = $DB->table('Category')->select ('Name', { FatherID => $cat_id })->fetchall_hashref;
my $output = '';
foreach my $subcat (@$subcats) {
$output .= "$subcat->{Name}<br>";
my $links = $DB->table('Links', 'CatLinks')->select ('Title', { CategoryID => $subcat->{ID} })->fetchall_hashref;
foreach my $link (@$links) {
$output .= "$link->{Title}";
}
}
return $output;
Try this (untested):
Code:
my $tags = shift; my $cat_id = $tags->{CategoryID};
return '' unless ($tags->{ShowSubCategoryLinks});
my $subcats = $DB->table('Category')->select ('Name', { FatherID => $cat_id })->fetchall_hashref;
my $output = '';
foreach my $subcat (@$subcats) {
$output .= "$subcat->{Name}<br>";
my $links = $DB->table('Links', 'CatLinks')->select ('Title', { CategoryID => $subcat->{ID} })->fetchall_hashref;
foreach my $link (@$links) {
$output .= "$link->{Title}";
}
}
return $output;