my $path = File::Spec->catdir('menus', $domain);
opendir my $dir, $path or die "can't open $path: $!";
my $path = File::Spec->catdir('menus', $domain);
opendir my $dir, $path or die "can't open $path: $!";
# first, some sanity check. are all parents valid ids or empty?
for my $node ($self->nodes) {
next if !exists $node->{parent} || !$node->{parent} || $self->{by_id}->{$node->{id}};
# first, some sanity check. are all parents valid ids or empty?
for my $node ($self->nodes) {
next if !exists $node->{parent} || !$node->{parent} || $self->{by_id}->{$node->{id}};