From da1f7513fd3b86ead76b330c37209d6ed95bd853 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 26 Nov 2019 10:18:26 +0100 Subject: [PATCH] =?utf8?q?WebDav:=20Fehler=20beim=20Kopieren=20anzeigen=20?= =?utf8?q?/=20Verzeichnis=20zur=C3=BCck=20wechseln=20(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Der erste commit 108753a78b203dbe0ccbe6438cc16c8df33c04d3 hat das Drucken ohne Fehler beim Ins-Webdav-Kopieren kaputt gemacht. Probleme waren: - ein return vergessen - chdir zurück auch ohne Fehler Diese commit fixt das. Bezieht sich auch auf #96 (redmine) Refs #96 --- SL/Common.pm | 1 + SL/Form.pm | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/SL/Common.pm b/SL/Common.pm index 193476c54..fb1b4b850 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -598,6 +598,7 @@ sub copy_file_to_webdav_folder { return $::locale->text("Copy file from #1 to #2 failed: #3", $current_file, $new_file, $ERRNO); } + return; $::lxdebug->leave_sub(); } diff --git a/SL/Form.pm b/SL/Form.pm index f162f2095..7414cdb4c 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1037,9 +1037,10 @@ sub parse_template { copy(join('/', $self->{cwd}, $userspath, $self->{tmpfile}), $out =~ m|^/| ? $out : join('/', $self->{cwd}, $out)) if $template->uses_temp_file; if ($copy_to_webdav) { - my $error = Common::copy_file_to_webdav_folder($self); - chdir("$self->{cwd}"); - $self->error($error) if $error; + if (my $error = Common::copy_file_to_webdav_folder($self)) { + chdir("$self->{cwd}"); + $self->error($error); + } } if (!$self->{preview} && $self->doc_storage_enabled) @@ -1056,9 +1057,10 @@ sub parse_template { } if ($copy_to_webdav) { - my $error = Common::copy_file_to_webdav_folder($self); - chdir("$self->{cwd}"); - $self->error($error) if $error; + if (my $error = Common::copy_file_to_webdav_folder($self)) { + chdir("$self->{cwd}"); + $self->error($error); + } } if ( !$self->{preview} && $ext_for_format eq 'pdf' && $self->doc_storage_enabled) { -- 2.20.1