1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #6354 from turbo124/v5-develop

Fixes for locking
This commit is contained in:
David Bomba 2021-07-28 16:12:19 +10:00 committed by GitHub
commit 433eddbcc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,10 +189,11 @@ class PreviewController extends BaseController
$class = RecurringInvoice::class;
}
DB::connection(config('database.default'))->beginTransaction();
try {
DB::connection(config('database.default'))->beginTransaction();
if($request->has('entity_id')){
$entity_obj = $class::withTrashed()->whereId($this->decodePrimaryKey($request->input('entity_id')))->company()->first();
@ -251,9 +252,13 @@ class PreviewController extends BaseController
->design($template)
->build();
DB::connection(config('database.default'))->rollBack();
if (request()->query('html') == 'true') {
return $maker->getCompiledHTML;
}
}
catch(\Exception $e){
@ -261,7 +266,6 @@ class PreviewController extends BaseController
}
DB::connection(config('database.default'))->rollBack();
//if phantom js...... inject here..
if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') {