sub used_tags
{
my($self)=@_;
- print "TAGTREE UNDEF\n" unless(defined($self->{tagtree}));
- return undef unless(defined($self->{tagtree}));
+ return() unless(defined($self->{tagtree}));
return($self->{tagtree}->used_tags());
}
sub tags
{
my($self)=@_;
- if(!@{$self->{elements}}) # /
+ if(!$self->{tagtree}) # / or /NOT
{
my $sql="SELECT DISTINCT name FROM tags WHERE parents_id='';";
return($self->{db}->cmd_firstcol($sql));
") AS subselect\n" .
"INNER JOIN files_x_tags ON subselect.files_id=files_x_tags.files_id\n" .
"INNER JOIN tags ON files_x_tags.tags_id=tags.id\n");
- my (@allused)=$self->used_tags();
+ my @allused=$self->used_tags();
my @used=grep { ref($_) ne "ARRAY"; } @allused;
my @used_with_vals=grep { ref($_) eq "ARRAY"; } @allused;
# print "tags(): USED: ", join(", ", @used), "\n";
# print "Trailing id: $tag\n";
}
my ($sqlclause, @joins)=(undef, ());
- ($sqlclause, @joins) = $tree->to_sql($tag) if($tree);
+ ($sqlclause, @joins) = $tree->to_sql() if($tree);
# print "SQL(" . scalar(@joins) .": $sqlclause\n";
my $sql="\tSELECT fxt1.files_id FROM tags t1";
my @crosses=();