From 29675d6b7ae3bcfbde5bb21d55f6e3a189a2e7c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 8 Nov 2017 17:09:36 +0100 Subject: [PATCH] Auftrags-Controller: Fehler beim Speichern im Dateimanagement abfangen und anzeigen --- SL/Controller/Order.pm | 7 ++++++- locale/de/all | 1 + locale/en/all | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index ab4401ef8..18c8b52b7 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -211,13 +211,18 @@ sub action_print { } } if ($self->order->ordnumber && $::instance_conf->get_doc_storage) { - SL::File->save( object_id => $self->order->id, + eval { + SL::File->save(object_id => $self->order->id, object_type => $self->type, mime_type => 'application/pdf', source => 'created', file_type => 'document', file_name => $pdf_filename, file_contents => $pdf); + 1; + } or do { + $self->js->flash('error', t8('Storing PDF in storage backend failed: #1', $@)); + } } $self->js->render; } diff --git a/locale/de/all b/locale/de/all index 52e85d2d0..734726ca2 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2926,6 +2926,7 @@ $self->{texts} = { 'Storage Type for generated/imported PDF Documents' => 'Speichertyp für erzeugte oder importierte Dokumente', 'Storage Type for images' => 'Speichertyp für Bilder', 'Storage Type for shopimages' => 'Speichertyp für Shopbilder', + 'Storing PDF in storage backend failed: #1' => 'Speichern der PDF-Datei im Datei-Speicher fehlgeschlagen: #1', 'Storing PDF to webdav folder failed: #1' => 'Speichern der PDF im WebDAV Ordner fehlgeschlagen: #1', 'Storing the emails in the journal is currently disabled in the client configuration.' => 'Das Speichern von versendeten E-Mails ist derzeit in der Mandantenkonfigurierung abgeschaltet.', 'Storno' => 'Storno', diff --git a/locale/en/all b/locale/en/all index 7f38936e1..88bbbc23c 100644 --- a/locale/en/all +++ b/locale/en/all @@ -2909,6 +2909,7 @@ $self->{texts} = { 'Storage Type for generated/imported PDF Documents' => '', 'Storage Type for images' => '', 'Storage Type for shopimages' => '', + 'Storing PDF in storage backend failed: #1' => '', 'Storing PDF to webdav folder failed: #1' => '', 'Storing the emails in the journal is currently disabled in the client configuration.' => '', 'Storno' => '', -- 2.20.1