I’m having all kinds of issues since the last update. I am currently using v5.3.68-C77, self hosted.
Firstly, the previewing of PDFs whilst editing an invoice is broken. Instead of the PDF, it just shows the message:
PlatformException(error, Promise was rejected with a value of 'undefined'., null, null)
The error in the log is:
[2022-03-16 16:01:17] production.ERROR: Argument 2 passed to App\Repositories\InvoiceRepository::save() must be an instance of App\Models\Invoice, null given, called in /app/Http/Controllers/PreviewController.php on line 214 {"userId":1,"exception":"[object] (TypeError(code: 0): Argument 2 passed to App\\Repositories\\InvoiceRepository::save() must be an instance of App\\Models\\Invoice, null given, called in /app/Http/Controllers/PreviewController.php on line 214 at /app/Repositories/InvoiceRepository.php:34)
Here’s an image with the full stack trace:
I am a white label customer, so I am using Invoice Ninja hosted for PDF generation.
If I select ‘View PDF’ from the menu, that will generate and view the PDF perfectly. It’s just the preview whilst editing that is broken.
As a side note, when the PDF generation fails, it completely crashed the IN desktop app on MacOS Monterey. I’m having to use a web browser now to access IN.
Secondly, when I go to email an invoice, it will show the PDF invoice OK on the screen, however it will then display a 500 server error in a popup that cannot be dismissed (even though it has a ‘Dismiss’ button, that button doesn’t work).
In the background I can see that it has not displayed my email template, so I guess that’s where it’s failing. The log file says:
[2022-03-16 16:14:14] production.ERROR: Trying to get property 'id' of non-object {"userId":1,"exception":"[object] (ErrorException(code: 0): Trying to get property 'id' of non-object at /app/Utils/TemplateEngine.php:93)
I was going to put an image of the full stack track here, but as a new user, I can’t. I can add it as a reply if needed.
Another odd thing is that before the update I had to go to /public/ for IN to work. Now going to that URL shows a 404 and I have to go to the plain / URL to get into the system.
I have used the ‘Force Update’ function and then I can again use the /public URL to access the system. No idea if this is related, but it’s definitely strange.
No idea if I actually need to have /public on the URL, but when I first installed IN 5 it would not work at all unless I did. Now it half works from both URLs.
I’ve run ‘artisan optimize’ several times and that changes nothing.
I wish I’d never clicked that update button, everything was working perfectly before. I have invoices that need to go out.
Any advice? I’ve been a happy customer of IN for years, paying my white label fee each year, but v5 has been absolutely terrible in terms of stability. Migration was an utter nightmare and getting everything to work properly took me a whole weekend (and I develop web apps for a living!).