- my $parent=$self->trailing_tag_parent();
-# print "THASVALS: $hasvals\n";
-# print "TPARENT: ", (defined($parent)? $parent : "NO"), "\n";
- my @ids=();
- my $sql=("SELECT tags.name FROM (\n" .
- $self->tags_subselect() .
- ") 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 @used=grep { ref($_) ne "ARRAY"; } @allused;
- my @used_with_vals=grep { ref($_) eq "ARRAY"; } @allused;
-# print "tags(): USED: ", join(", ", @used), "\n";
-# print "tags(): USED_WITH_VALS: ", join(", ", map { "[".$_->[0]. ", ".$_->[1]."]";} @used_with_vals), "\n";
- my @orclauses=();
- my @andclauses=();
- my $id=$self->trailing_tag_id();
- if($hasvals)