X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCommon.pm;h=33d4d41cf48705c563500b6defac83667a66ae7f;hb=0c537bffbf60f078202ca72977b3e35f2e0f0fd7;hp=82cadbfaf702366cc766c5968f28d952c214ebd0;hpb=d5959d7e55714a2f499d7dea6ed33145f6176311;p=kivitendo-erp.git 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);