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'; $backend->{name} = 'DB';
} }
elsif ( $backend->{hafas} ) { elsif ( $backend->{hafas} ) {
$type = 'HAFAS'; if ( my $s = $self->hafas->get_service( $backend->{name} ) ) {
$backend->{longname} $type = 'HAFAS';
= $self->hafas->get_service( $backend->{name} )->{name}; $backend->{longname} = $s->{name};
}
else {
$type = undef;
}
} }
$backend->{type} = $type; $backend->{type} = $type;
} }
@backends = grep { $_->{type} } @backends;
$self->render( $self->render(
'select_backend', 'select_backend',
backends => \@backends, backends => \@backends,