Only rollback if we are in a transaction.

This commit is contained in:
DAViCal Administrator 2011-05-12 17:42:15 -04:00
parent d6916b205c
commit 13fa85d8ab

View File

@ -38,7 +38,7 @@ function rollback_on_error( $caldav_context, $user_no, $path, $message='', $erro
global $c, $bad_events;
if ( !$message ) $message = translate('Database error');
$qry = new AwlQuery();
$qry->Rollback();
if ( $qry->TransactionState() != 0 ) $qry->Rollback();
if ( $caldav_context ) {
if ( isset($bad_events) && isset($c->skip_bad_event_on_import) && $c->skip_bad_event_on_import ) {
$bad_events[] = $message;