mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Log error if we fail to parse the invoice history backup
This commit is contained in:
parent
56856f1435
commit
4ce11fd9f6
@ -578,7 +578,7 @@ class InvoiceController extends BaseController
|
||||
$lastId = false;
|
||||
|
||||
foreach ($activities as $activity) {
|
||||
$backup = json_decode($activity->json_backup);
|
||||
if ($backup = json_decode($activity->json_backup)) {
|
||||
$backup->invoice_date = Utils::fromSqlDate($backup->invoice_date);
|
||||
$backup->due_date = Utils::fromSqlDate($backup->due_date);
|
||||
$backup->features = [
|
||||
@ -593,9 +593,14 @@ class InvoiceController extends BaseController
|
||||
$key = Utils::timestampToDateTimeString(strtotime($activity->created_at)) . ' - ' . $activity->user->getDisplayName();
|
||||
$versionsSelect[$lastId ? $lastId : 0] = $key;
|
||||
$lastId = $activity->id;
|
||||
} else {
|
||||
Utils::logError('Failed to parse invoice backup');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastId) {
|
||||
$versionsSelect[$lastId] = Utils::timestampToDateTimeString(strtotime($invoice->created_at)) . ' - ' . $invoice->user->getDisplayName();
|
||||
}
|
||||
|
||||
$data = [
|
||||
'invoice' => $invoice,
|
||||
|
Loading…
x
Reference in New Issue
Block a user