backend selection: handle backends that are no longer supported

This commit is contained in:
Birte Kristina Friesel 2024-08-10 19:35:53 +02:00
parent 78d4494364
commit e6ba4b0e3b
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -1012,13 +1012,19 @@ sub backend_form {
$backend->{name} = 'DB';
}
elsif ( $backend->{hafas} ) {
$type = 'HAFAS';
$backend->{longname}
= $self->hafas->get_service( $backend->{name} )->{name};
if ( my $s = $self->hafas->get_service( $backend->{name} ) ) {
$type = 'HAFAS';
$backend->{longname} = $s->{name};
}
else {
$type = undef;
}
}
$backend->{type} = $type;
}
@backends = grep { $_->{type} } @backends;
$self->render(
'select_backend',
backends => \@backends,