diff --git a/lib/GLPI/Agent/HTTP/Server/ToolBox/Results.pm b/lib/GLPI/Agent/HTTP/Server/ToolBox/Results.pm index e7b0568b8..d98ae192b 100644 --- a/lib/GLPI/Agent/HTTP/Server/ToolBox/Results.pm +++ b/lib/GLPI/Agent/HTTP/Server/ToolBox/Results.pm @@ -419,7 +419,8 @@ sub handle_form { } } elsif ($form->{'submit/export'} || $form->{'submit/full-export'}) { $self->debug("Doing export for GLPI integration"); - my $archiver = $self->_get_archiver(); + my $archiver = $self->_get_archiver() + or return $self->errors("Download results: No archiving software available"); my @time = localtime(); my $tag_filter = $self->get_from_session('tag_filter'); my $base_folder = $yaml_config->{networktask_save} || '.'; @@ -671,6 +672,8 @@ sub _register_supported_modules { sub _supported_archive_formats { my ($self) = @_; + return [''] unless $self->{_archive_formats}; + my @supported = map { $_->format() } sort { $a->order <=> $b->order } @{$self->{_archive_formats}}; return \@supported; @@ -679,6 +682,8 @@ sub _supported_archive_formats { sub _get_archiver { my ($self) = @_; + return unless $self->{_archive_formats}; + my $yaml_config = $self->yaml('configuration') || {}; my $format = $yaml_config->{'archive_format'} || $self->_supported_archive_formats()->[0]; my ($archiver) = grep { $_->format() eq $format } @{$self->{_archive_formats}}; diff --git a/share/html/toolbox/errors-language-en.txt b/share/html/toolbox/errors-language-en.txt index 7be91fa68..b00d2bb26 100644 --- a/share/html/toolbox/errors-language-en.txt +++ b/share/html/toolbox/errors-language-en.txt @@ -43,6 +43,7 @@ Delete credential: No credential selected: Can't delete used credential: +No archiving software available: Deleting results: No result selected: Can't remove file: diff --git a/share/html/toolbox/errors-language-fr.txt b/share/html/toolbox/errors-language-fr.txt index bce0058a7..7dbed4db4 100644 --- a/share/html/toolbox/errors-language-fr.txt +++ b/share/html/toolbox/errors-language-fr.txt @@ -43,6 +43,7 @@ Delete credential: Suppression d'identifiant No credential selected: Pas d'identifiant sélectionné Can't delete used credential: Impossible de supprimer un identifiant utilisé +No archiving software available: Aucun programme d'archivage disponible Deleting results: Suppression de résultats No result selected: Pas de résultat sélectionné Can't remove file: Impossible de supprimer le fichier