mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for FlySystem exceptions for corrupt paths
This commit is contained in:
parent
b42ae9023b
commit
240df693a5
@ -409,7 +409,19 @@ class Invoice extends BaseModel
|
||||
|
||||
$file_path = $this->client->invoice_filepath($invitation).$this->numberFormatter().'.pdf';
|
||||
|
||||
if(Ninja::isHosted() && $portal && Storage::disk(config('filesystems.default'))->exists($file_path)){
|
||||
$file_exists = false;
|
||||
|
||||
/* Flysystem throws an exception if the path is "corrupted" so lets wrap it in a try catch and return a bool 06/01/2022*/
|
||||
try{
|
||||
$file_exists = Storage::disk(config('filesystems.default'))->exists($file_path);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
|
||||
nlog($e->getMessage());
|
||||
|
||||
}
|
||||
|
||||
if(Ninja::isHosted() && $portal && $file_exists){
|
||||
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
|
||||
}
|
||||
elseif(Ninja::isHosted()){
|
||||
@ -417,7 +429,16 @@ class Invoice extends BaseModel
|
||||
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
|
||||
}
|
||||
|
||||
if(Storage::disk('public')->exists($file_path))
|
||||
try{
|
||||
$file_exists = Storage::disk('public')->exists($file_path);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
|
||||
nlog($e->getMessage());
|
||||
|
||||
}
|
||||
|
||||
if($file_exists)
|
||||
return Storage::disk('public')->{$type}($file_path);
|
||||
|
||||
$file_path = CreateEntityPdf::dispatchNow($invitation);
|
||||
|
@ -157,7 +157,8 @@ class AuthorizePaymentMethod
|
||||
$paymentOne->setOpaqueData($op);
|
||||
|
||||
$contact = $this->authorize->client->primary_contact()->first();
|
||||
|
||||
$billto = false;
|
||||
|
||||
if ($contact) {
|
||||
// Create the Bill To info for new payment type
|
||||
$billto = new CustomerAddressType();
|
||||
|
Loading…
x
Reference in New Issue
Block a user