Unable to edit invoices or quotes after update.

Hi there,

I am currently running self hosted V3.1.3 installed using Softaculous.

When attempting to update using Softaculous to V4.2.2, the process seems to run correctly, but after the update I am unable to edit invoices or quotes. Clicking on to them in my list gives the vague ‘Something went wrong’ message.

Attached below is the error log (sensitive info removed).

[2018-03-27 03:25:00] production.ERROR: ErrorException [0] : /home/$user/public_html/accounts/app/Models/Traits/SendsEmails.php [Line 42] => Trying to get property of non-object (View: /home/$user/public_html/accounts/resources/views/invoices/email.blade.php) (View: /home/$user/public_html/accounts/resources/views/invoices/email.blade.php) {"context":"PHP","user_id":1,"account_id":"1","user_name":"$user","method":"GET","url":"https://$domain/invoices/133/edit","previous":"https://$domain/dashboard","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6","ip":"$ip","count":2,"is_console":"no","is_api":"no","db_server":"mysql"} []

I’ve tried visiting /update on my server and get a success message, ive also tried running

php artisan cache:clear
but that didn't seem to help either.

Any assistance would be much appreciated!


What code do you see on line 42 of resources/views/invoices/email.blade.php

                        <li role="presentation">
                            <a href="#history" aria-controls="history" role="tab" data-toggle="tab">{{ trans('texts.history') }}</a>

Line 42 onwards reads as follows

This is the entire DIV starting from line 30

                            <a href="#preview">{{ trans('texts.preview') }}</a>
                        @if (Utils::isPro())
                                <a href="#customize">
                                    {{ trans('texts.customize') }} {!! Auth::user()->isTrial() ? '' . trans('texts.pro') . '' : '' !!}
                            <a href="#history">{{ trans('texts.history') }}</a>

I think I see the source of the problem, are there any records in the account_email_settings table? If not you can try adding a record linked to your account id.

If you’d like to send a database backup from before the upgrade to contact@invoiceninja.com I can try to debug the problem with the migration.

Bingo! Table was indeed empty.

Adding a row with account ID made it all function and was able to correctly populate the row from the backend settings.

The only backup I have is a combined backup in Softaculous format, so it would be difficult to remove confidential information. If there is more testing you’d like me to do to help with future migration efforts please let me know.

Thanks for all your help,