Zwei Datenbankwarnungen vermeiden: cannot convert '' to number
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 24 Apr 2013 08:32:13 +0000 (10:32 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 24 Apr 2013 08:32:13 +0000 (10:32 +0200)
bin/mozilla/io.pl

index 9c76b45..d156767 100644 (file)
@@ -1596,11 +1596,11 @@ sub print_form {
   # prepare meta information for template introspection
   $form->{template_meta} = {
     formname  => $form->{formname},
-    language  => SL::DB::Manager::Language->find_by_or_create(id => $form->{language_id}),
+    language  => SL::DB::Manager::Language->find_by_or_create(id => $form->{language_id} || undef),
     format    => $form->{format},
     media     => $form->{media},
     extension => $extension,
-    printer   => SL::DB::Manager::Printer->find_by_or_create(id => $form->{printer_id}),
+    printer   => SL::DB::Manager::Printer->find_by_or_create(id => $form->{printer_id} || undef),
     today     => DateTime->today,
   };