From b599ced4da29355a213cf9349a0e87f1ec8ee77f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 7 Feb 2014 16:58:38 +0100 Subject: [PATCH] Bugfix: Fehler beim Generieren und Drucken wiederkehrender Rechnungen mit eingeschaltetem Webav-Feature fixt #2446 --- SL/Common.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SL/Common.pm b/SL/Common.pm index 82cadbfaf..33d4d41cf 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -623,6 +623,16 @@ sub copy_file_to_webdav_folder { } $complete_path = File::Spec->catfile($form->{cwd}, $webdav_folder); + + # maybe the path does not exist (automatic printing), see #2446 + if (!-d $complete_path) { + # we need a chdir and restore old dir + my $current_dir = POSIX::getcwd(); + chdir("$form->{cwd}"); + mkdir_with_parents($webdav_folder); + chdir($current_dir); + } + opendir my $dh, $complete_path or die "Could not open $complete_path: $!"; my ($newest_name, $newest_time); -- 2.20.1