]> wagnertech.de Git - kivitendo-erp.git/commitdiff
$form->get_standard_dbh nicht von Rose geƶffnetes Datenbankhandle nutzen lassen
authorMoritz Bunkus <moritz@bunkus.org>
Thu, 3 Feb 2011 09:19:47 +0000 (10:19 +0100)
committerMoritz Bunkus <moritz@bunkus.org>
Thu, 3 Feb 2011 09:19:47 +0000 (10:19 +0100)
Rose setzt Datenbankhandle auf autocommit. Die Semantik von
get_standard_dbh ist aber, dass autocommit aus ist und die Funktionen
selber ein Commit machen.

SL/Form.pm
SL/OE.pm

index 0637e6ebb4d92b063d8333f0579c626f4e764acb..bd16b4c307f1681af5fc06f60df239ceb400ea5a 100644 (file)
@@ -1616,7 +1616,7 @@ sub get_standard_dbh {
     undef $standard_dbh;
   }
 
-  $standard_dbh ||= SL::DB::create->dbh;
+  $standard_dbh ||= $self->dbconnect_noauto($myconfig);
 
   $main::lxdebug->leave_sub(2);
 
index 8adaf6af24677961895503d60bcd5500d4b86c81..28e3975c3c1163991f8e79a2918815ea4d7ec81f 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -559,11 +559,6 @@ sub save {
     }
   }
 
-  $self->save_periodic_invoices_config(dbh         => $dbh,
-                                       oe_id       => $form->{id},
-                                       config_yaml => $form->{periodic_invoices_config})
-    if ($form->{type} eq 'sales_order');
-
   $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ?
                                        "quonumber" : "ordnumber"};
 
@@ -571,6 +566,11 @@ sub save {
 
   my $rc = $dbh->commit;
 
+  $self->save_periodic_invoices_config(dbh         => $dbh,
+                                       oe_id       => $form->{id},
+                                       config_yaml => $form->{periodic_invoices_config})
+    if ($form->{type} eq 'sales_order');
+
   $main::lxdebug->leave_sub();
 
   return $rc;