X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FMenu.pm;h=6bbcffb9c8af8adbfc42883522e3298b47a2e5cd;hb=b29878cbc8a4fa1e0959fca593a91242894315fd;hp=8cc9c7e06071f8a307ea14bd80549f79a15ba831;hpb=4247547d2a925ddad7006cae89e5f9f1fda7d469;p=kivitendo-erp.git diff --git a/SL/Menu.pm b/SL/Menu.pm index 8cc9c7e06..6bbcffb9c 100644 --- a/SL/Menu.pm +++ b/SL/Menu.pm @@ -21,7 +21,7 @@ sub new { my $path = File::Spec->catdir('menus', $domain); opendir my $dir, $path or die "can't open $path: $!"; - my @files = sort grep -f "$path/$_", readdir $dir; + my @files = sort grep -f "$path/$_", grep /\.yaml$/, readdir $dir; close $dir; my $nodes = []; @@ -103,7 +103,7 @@ sub build_tree { my %by_parent; # order them by parent for my $node ($self->nodes) { - push @{ $by_parent{ $node->{parent} } //= [] }, $node; + push @{ $by_parent{ $node->{parent} // '' } //= [] }, $node; } my $tree = { };